Add check image exists
This commit is contained in:
parent
6310c88ab8
commit
155ec1c1b5
|
@ -1,11 +1,11 @@
|
|||
name: Verify Format
|
||||
name: Verify PR
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
branches: [main]
|
||||
|
||||
jobs:
|
||||
Patch:
|
||||
Check:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
|
@ -15,3 +15,6 @@ jobs:
|
|||
- name: Verify mirror.txt
|
||||
run: |
|
||||
./hack/verify-fmt.sh mirror.txt || { echo "Please run './hack/fmt.sh mirror.txt'"; exit 1; }
|
||||
- name: Verify Image Exists
|
||||
run: |
|
||||
./hack/verify-image.sh https://github.com/${{ github.repository }}/pull/${{ github.event.pull_request.number }}.patch
|
|
@ -0,0 +1,15 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
patch_url=$1
|
||||
|
||||
file=mirror.txt
|
||||
|
||||
cp "${file}" "${file}.bak"
|
||||
|
||||
git apply -R <(curl -fsSL "${patch_url}")
|
||||
|
||||
list=$(diff --unified "${file}" "${file}.bak" | grep -e '^+\w' | sed 's/^+//')
|
||||
|
||||
for image in ${list}; do
|
||||
skopeo inspect --raw "docker://${image}" || { echo "Not Found ${image}" ; exit 1; }
|
||||
done
|
Loading…
Reference in New Issue