Update verify-pr.yml (#182)

This commit is contained in:
Shiming Zhang 2022-08-17 22:08:11 +08:00 committed by GitHub
parent 709a31d863
commit b8a7dbe2ce
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 27 additions and 7 deletions

View File

@ -4,6 +4,9 @@ on:
pull_request: pull_request:
branches: [main] branches: [main]
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
jobs: jobs:
Check: Check:
runs-on: ubuntu-latest runs-on: ubuntu-latest
@ -11,16 +14,33 @@ jobs:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
- name: Verify domain.txt - name: Verify domain.txt
run: | run: |
./hack/verify-fmt.sh domain.txt || { echo "Please run './hack/fmt.sh domain.txt'"; exit 1; } ./hack/verify-fmt.sh domain.txt || {
echo "Please run './hack/fmt.sh domain.txt'"
gh pr comment "${{ github.event.pull_request.number }}" --body "请运行 `./hack/fmt.sh domain.txt` 对内容进行排序"
exit 1
}
- name: Verify mirror.txt - name: Verify mirror.txt
run: | run: |
./hack/verify-fmt.sh mirror.txt || { echo "Please run './hack/fmt.sh mirror.txt'"; exit 1; } ./hack/verify-fmt.sh mirror.txt || {
- name: Verify docker prefix echo "Please run './hack/fmt.sh domain.txt'"
gh pr comment "${{ github.event.pull_request.number }}" --body "请运行 `./hack/fmt.sh mirror.txt` 对内容进行排序"
exit 1
}
- name: Verify docker Prefix
run: | run: |
./hack/verify-docker-prefix.sh mirror.txt ./hack/verify-docker-prefix.sh mirror.txt || {
- name: Verify k8s prefix gh pr comment "${{ github.event.pull_request.number }}" --body "请成对提交 `docker.io/*` 和 `docker.io/library/*` 形式的镜像"
exit 1
}
- name: Verify k8s Prefix
run: | run: |
./hack/verify-k8s-prefix.sh mirror.txt ./hack/verify-k8s-prefix.sh mirror.txt || {
gh pr comment "${{ github.event.pull_request.number }}" --body "请使用 `registry.k8s.io/*` 替代 `k8s.gcr.io/*`"
exit 1
}
- name: Verify Image Exists - name: Verify Image Exists
run: | run: |
./hack/verify-image.sh mirror.txt https://github.com/${{ github.repository }}/pull/${{ github.event.pull_request.number }}.patch ./hack/verify-image.sh mirror.txt https://github.com/${{ github.repository }}/pull/${{ github.event.pull_request.number }}.patch || {
gh pr comment "${{ github.event.pull_request.number }}" --body "有镜像不存在请检查后重新提交"
exit 1
}