From 9f85b9b20dbbd9f5106b5a7fbb7ab8f9738a3387 Mon Sep 17 00:00:00 2001 From: Shiming Zhang Date: Thu, 12 Oct 2023 17:18:37 +0800 Subject: [PATCH] Fix target sync (#393) --- .github/workflows/target-image-sync.yml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/target-image-sync.yml b/.github/workflows/target-image-sync.yml index 361ff89..ab461af 100644 --- a/.github/workflows/target-image-sync.yml +++ b/.github/workflows/target-image-sync.yml @@ -18,8 +18,10 @@ jobs: - name: Checkout repository uses: actions/checkout@v2 - name: Check Issue + env: + MESSAGE: "${{ github.event.issue.body }}" run: | - IMAGE=$(echo "${{ github.event.issue.body }}" | grep SYNC | awk '{print $2}' | head -n 1) + IMAGE=$(echo "${MESSAGE}" | grep SYNC | awk '{print $2}' | head -n 1) if [[ -z "${IMAGE}" ]]; then gh issue comment ${{ github.event.issue.number }} -b "找不到镜像呢" gh issue edit ${{ github.event.issue.number }} --title "FAILED SYNC IMAGE" @@ -57,16 +59,15 @@ jobs: PARALLET: "1" http_proxy: socks5://127.0.0.1:8080 https_proxy: socks5://127.0.0.1:8080 + MESSAGE: "${{ github.event.issue.body }}" run: | - IMAGE=$(echo "${{ github.event.issue.body }}" | grep SYNC | awk '{print $2}' | head -n 1) + IMAGE=$(echo "${MESSAGE}" | grep SYNC | awk '{print $2}' | head -n 1) ./hack/diff-image.sh "${IMAGE}" "m.daocloud.io/${IMAGE}" if [[ $? -ne 0 ]]; then gh issue comment ${{ github.event.issue.number }} -b "镜像 ${IMAGE} 同步失败" gh issue edit ${{ github.event.issue.number }} --title "FAILED SYNC IMAGE ${IMAGE}" - gh issue close ${{ github.event.issue.number }} --reason "not planned" exit 1 else - IMAGE=$(echo "${{ github.event.issue.body }}" | grep SYNC | awk '{print $2}' | head -n 1) gh issue comment ${{ github.event.issue.number }} -b "镜像 ${IMAGE} 同步完成
请使用 m.daocloud.io/${IMAGE} 替代源镜像" gh issue close ${{ github.event.issue.number }} --reason "completed" fi