Corrections to image metadata check CI (#9256)

* don't just compare webp

* fix license check
This commit is contained in:
doofus-01 2024-08-25 17:41:08 -07:00 committed by GitHub
parent f684c20dac
commit bd4c83f955
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -34,11 +34,10 @@ jobs:
- name: read/export image metadata
run: |
mapfile -t image_files < <(git diff --name-only ${BASE_SHA} ${SHA} | grep '\.webp$')
mapfile -t image_files < <(git diff --name-only "$BASE_SHA" "$SHA" | grep -E '\.(webp|png|je?pg)$'))
git status
# array of accepted copyright strings
accepted_cr=("GNU GPL v2+" "CC BY-SA 4.0")
accepted_cr=("GNU GPL v2+|CC BY-SA 4.0|CC0")
# cycle through the changed image files, make sure they have the right fields
for file in "${image_files[@]}"; do
# check -Artist tag, fail if missing
@ -56,7 +55,7 @@ jobs:
if [ -z "$copyright" ] ; then
echo "no Copyright EXIF tag in $file"
exit 1
elif [[ ( "$copyright" != ${accepted_cr[0]} ) && ( "$copyright" != ${accepted_cr[1]}) ]] ; then
elif [[ ! "|${accepted_cr[*]}|" =~ "|${copyright}|" ]]; then
echo "$copyright is not an accepted license"
exit 1
else