From 2c2cb42cdc54867da1f16f13a95123f5a0cdc409 Mon Sep 17 00:00:00 2001 From: Fabio Bonelli Date: Thu, 12 Nov 2026 14:35:46 +0000 Subject: [PATCH] fix: keep the IPA code list when its download fails The update workflow piped curl output straight into the list, so an HTTP error page could replace it and reach the automated PR. --- .github/workflows/file-freshness-pr.yml | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) 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"