mirror of
https://github.com/DaoCloud/public-image-mirror.git
synced 2025-10-30 13:09:22 +08:00
Update allows information in sync
This commit is contained in:
8
.github/workflows/target-image-sync.yml
vendored
8
.github/workflows/target-image-sync.yml
vendored
@@ -60,14 +60,14 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
ORIGIN_IMAGE=$(echo "${MESSAGE}" | grep SYNC | awk '{print $2}' | head -n 1 | sed "s/\r//g")
|
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}"
|
curl --fail -X PUT "http://127.0.0.1:8000/internal/api/image/sync?image=${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} 替代源镜像"
|
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 edit ${{ github.event.issue.number }} --add-label "sync image succeeded" -b "IMAGE SYNC"
|
||||||
gh issue close ${{ github.event.issue.number }} --reason "completed"
|
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
|
- name: Fail Sync
|
||||||
if: failure()
|
if: failure()
|
||||||
env:
|
env:
|
||||||
|
|||||||
8
.github/workflows/target-sync-image.yml
vendored
8
.github/workflows/target-sync-image.yml
vendored
@@ -55,14 +55,14 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
ORIGIN_IMAGE="${{ steps.get-image.outputs.image }}"
|
ORIGIN_IMAGE="${{ steps.get-image.outputs.image }}"
|
||||||
curl --fail -X PUT "http://127.0.0.1:8000/internal/api/image/sync?image=${ORIGIN_IMAGE}"
|
curl --fail -X PUT "http://127.0.0.1:8000/internal/api/image/sync?image=${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} 替代源镜像"
|
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 edit ${{ github.event.issue.number }} --add-label "sync image succeeded" -b "IMAGE SYNC"
|
||||||
gh issue close ${{ github.event.issue.number }} --reason "completed"
|
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
|
- name: Fail Sync
|
||||||
if: failure()
|
if: failure()
|
||||||
run: |
|
run: |
|
||||||
|
|||||||
Reference in New Issue
Block a user