diff --git a/.github/workflows/file-freshness-pr.yml b/.github/workflows/file-freshness-pr.yml index 99c36c8..fdd21e9 100644 --- a/.github/workflows/file-freshness-pr.yml +++ b/.github/workflows/file-freshness-pr.yml @@ -17,10 +17,15 @@ jobs: with: persist-credentials: false - name: Sync IPA codes from vocabulary repo - run: > - curl -sL 'https://raw.githubusercontent.com/publiccodeyml/italian-organizations-ipa-vocabulary/main/ipa-codes.txt' - | sed 's|^urn:x-italian-pa:||' - | LC_COLLATE=C sort > data/it/ipa_codes.txt + run: | + list="$RUNNER_TEMP/ipa-codes.txt" + curl -fsSL -o "$list" 'https://raw.githubusercontent.com/publiccodeyml/italian-organizations-ipa-vocabulary/main/ipa-codes.txt' + test -s "$list" + if grep -qvE '^urn:x-italian-pa:[A-Za-z0-9_]+$' "$list"; then + echo '::error::Unexpected line in the downloaded IPA code list' + exit 1 + fi + sed 's|^urn:x-italian-pa:||' "$list" | LC_COLLATE=C sort > data/it/ipa_codes.txt - uses: peter-evans/create-pull-request@5f6978faf089d4d20b00c7766989d076bb2fc7f1 # v8 with: commit-message: "chore: update it/ipa_codes.txt"