Update allows information in sync

This commit is contained in:
Shiming Zhang 2024-06-18 18:07:05 +08:00
parent cb5665e33e
commit 128b01fb3d
2 changed files with 10 additions and 10 deletions

View File

@ -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} 同步完成<br>请使用 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} 同步完成<br>请使用 m.daocloud.io/${ORIGIN_IMAGE} 替代源镜像<br>这个镜像不在白名单列表里, 在未来可能将无法访问<br>将其添加到[白名单](https://github.com/DaoCloud/public-image-mirror/blob/main/allows.txt)"
else
gh issue comment ${{ github.event.issue.number }} -b "镜像 ${ORIGIN_IMAGE} 同步完成<br>请使用 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 "这个镜像不在白名单列表里, 在未来可能将无法访问<br>将其添加到[白名单](https://github.com/DaoCloud/public-image-mirror/blob/main/allows.txt)"
fi
- name: Fail Sync
if: failure()
env:

View File

@ -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} 同步完成<br>请使用 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} 同步完成<br>请使用 m.daocloud.io/${ORIGIN_IMAGE} 替代源镜像<br>这个镜像不在白名单列表里, 在未来可能将无法访问<br>将其添加到[白名单](https://github.com/DaoCloud/public-image-mirror/blob/main/allows.txt)"
else
gh issue comment ${{ github.event.issue.number }} -b "镜像 ${ORIGIN_IMAGE} 同步完成<br>请使用 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 "这个镜像不在白名单列表里, 在未来可能将无法访问<br>将其添加到[白名单](https://github.com/DaoCloud/public-image-mirror/blob/main/allows.txt)"
fi
- name: Fail Sync
if: failure()
run: |