diff --git a/.github/workflows/target-image-sync.yml b/.github/workflows/target-image-sync.yml
index 6829d10..8b3e1fb 100644
--- a/.github/workflows/target-image-sync.yml
+++ b/.github/workflows/target-image-sync.yml
@@ -60,14 +60,14 @@ jobs:
run: |
ORIGIN_IMAGE=$(echo "${MESSAGE}" | grep SYNC | awk '{print $2}' | head -n 1 | sed "s/\r//g")
curl --fail -X PUT "http://127.0.0.1:8000/internal/api/image/sync?image=${ORIGIN_IMAGE}"
- gh issue comment ${{ github.event.issue.number }} -b "镜像 ${ORIGIN_IMAGE} 同步完成
请使用 m.daocloud.io/${ORIGIN_IMAGE} 替代源镜像"
+ if ! ./hack/verify-allows.sh ./allows.txt "${ORIGIN_IMAGE}"; then
+ gh issue comment ${{ github.event.issue.number }} -b "镜像 ${ORIGIN_IMAGE} 同步完成
请使用 m.daocloud.io/${ORIGIN_IMAGE} 替代源镜像
这个镜像不在白名单列表里, 在未来可能将无法访问
将其添加到[白名单](https://github.com/DaoCloud/public-image-mirror/blob/main/allows.txt)"
+ else
+ gh issue comment ${{ github.event.issue.number }} -b "镜像 ${ORIGIN_IMAGE} 同步完成
请使用 m.daocloud.io/${ORIGIN_IMAGE} 替代源镜像"
+ fi
gh issue edit ${{ github.event.issue.number }} --add-label "sync image succeeded" -b "IMAGE SYNC"
gh issue close ${{ github.event.issue.number }} --reason "completed"
- if ! ./hack/verify-allows.sh ./allows.txt "${ORIGIN_IMAGE}"; then
- gh issue comment ${{ github.event.issue.number }} -b "这个镜像不在白名单列表里, 在未来可能将无法访问
将其添加到[白名单](https://github.com/DaoCloud/public-image-mirror/blob/main/allows.txt)"
- fi
-
- name: Fail Sync
if: failure()
env:
diff --git a/.github/workflows/target-sync-image.yml b/.github/workflows/target-sync-image.yml
index fce8ba1..c875245 100644
--- a/.github/workflows/target-sync-image.yml
+++ b/.github/workflows/target-sync-image.yml
@@ -55,14 +55,14 @@ jobs:
run: |
ORIGIN_IMAGE="${{ steps.get-image.outputs.image }}"
curl --fail -X PUT "http://127.0.0.1:8000/internal/api/image/sync?image=${ORIGIN_IMAGE}"
- gh issue comment ${{ github.event.issue.number }} -b "镜像 ${ORIGIN_IMAGE} 同步完成
请使用 m.daocloud.io/${ORIGIN_IMAGE} 替代源镜像"
+ if ! ./hack/verify-allows.sh ./allows.txt "${ORIGIN_IMAGE}"; then
+ gh issue comment ${{ github.event.issue.number }} -b "镜像 ${ORIGIN_IMAGE} 同步完成
请使用 m.daocloud.io/${ORIGIN_IMAGE} 替代源镜像
这个镜像不在白名单列表里, 在未来可能将无法访问
将其添加到[白名单](https://github.com/DaoCloud/public-image-mirror/blob/main/allows.txt)"
+ else
+ gh issue comment ${{ github.event.issue.number }} -b "镜像 ${ORIGIN_IMAGE} 同步完成
请使用 m.daocloud.io/${ORIGIN_IMAGE} 替代源镜像"
+ fi
gh issue edit ${{ github.event.issue.number }} --add-label "sync image succeeded" -b "IMAGE SYNC"
gh issue close ${{ github.event.issue.number }} --reason "completed"
- if ! ./hack/verify-allows.sh ./allows.txt "${ORIGIN_IMAGE}"; then
- gh issue comment ${{ github.event.issue.number }} -b "这个镜像不在白名单列表里, 在未来可能将无法访问
将其添加到[白名单](https://github.com/DaoCloud/public-image-mirror/blob/main/allows.txt)"
- fi
-
- name: Fail Sync
if: failure()
run: |