Update pr verify (#23366)

* Fix fmt-image-match.sh

* Update pr verify
This commit is contained in:
Shiming Zhang
2024-08-01 16:11:35 +08:00
committed by GitHub
parent 863d1bbf64
commit 4f82ddf66d
2 changed files with 41 additions and 4 deletions

View File

@@ -7,6 +7,7 @@ on:
- 'domain.txt'
- 'mirror.txt'
- 'allows.txt'
- 'privileged.txt'
permissions:
issues: write
@@ -59,6 +60,7 @@ jobs:
gh pr comment "${{ github.event.pull_request.number }}" --body '请运行 `./hack/fmt-image-match.sh allows.txt` 对内容进行排序'
exit 1
}
- name: Verify privileged.txt sort
run: |
./hack/verify-image-match.sh privileged.txt || {
@@ -66,6 +68,25 @@ jobs:
gh pr comment "${{ github.event.pull_request.number }}" --body '请运行 `./hack/fmt-image-match.sh privileged.txt` 对内容进行排序'
exit 1
}
- name: Verify privileged.txt in allows.txt
run: |
cat privileged.txt >>allows.txt
./hack/fmt-image-match.sh allows.txt
git --no-pager diff --exit-code || {
gh pr comment "${{ github.event.pull_request.number }}" --body '部分 privileged.txt 镜像未加到 allows.txt. 请运行 `cat privileged.txt >>allows.txt; ./hack/fmt-image-match.sh allows.txt`'
exit 1
}
- name: Verify mirror.txt in allows.txt
run: |
cat mirror.txt >>allows.txt
./hack/fmt-image-match.sh allows.txt
git --no-pager diff --exit-code || {
gh pr comment "${{ github.event.pull_request.number }}" --body '部分 mirror.txt 镜像未加到 allows.txt, 请运行 `cat mirror.txt >>allows.txt; ./hack/fmt-image-match.sh allows.txt`'
exit 1
}
- name: Verify Image Exists
run: |
./hack/verify-image.sh mirror.txt https://github.com/${{ github.repository }}/pull/${{ github.event.pull_request.number }}.patch || {