fix(publish): a first release attempt no longer fails looking for an artifact a retry would reuse (#7929)

This commit is contained in:
Miguel Ángel
2026-11-16 07:08:10 +00:00
committed by GitHub
parent 916bcc83a6
commit 9f85cf0a25
2 changed files with 48 additions and 2 deletions
+2 -2
View File
@@ -172,7 +172,7 @@ jobs:
RUN_ID: ${{ github.run_id }}
run: |
gh api --paginate "repos/$REPO/actions/runs/$RUN_ID/artifacts?per_page=100" > "$RUNNER_TEMP/previous_bundle-pages.json"
FOUND="$(jq -sce '[.[].artifacts[] | select(.name == "release-bundle")] | if length == 0 then "" elif length == 1 and .[0].expired == false then .[0].id | tostring else error("Missing valid unique release-bundle") end' "$RUNNER_TEMP/previous_bundle-pages.json")"
FOUND="$(jq -sre '[.[].artifacts[] | select(.name == "release-bundle")] | if length == 0 then "" elif length == 1 and .[0].expired == false then .[0].id | tostring else error("Missing valid unique release-bundle") end' "$RUNNER_TEMP/previous_bundle-pages.json")"
echo "artifact=${FOUND}" >> "$GITHUB_OUTPUT"
- name: Restore previous release bundle
@@ -584,7 +584,7 @@ jobs:
RUN_ID: ${{ github.run_id }}
run: |
gh api --paginate "repos/$REPO/actions/runs/$RUN_ID/artifacts?per_page=100" > "$RUNNER_TEMP/previous_receipt-pages.json"
FOUND="$(jq -sce '[.[].artifacts[] | select(.name == "lambda-release-receipt")] | if length == 0 then "" elif length == 1 and .[0].expired == false then .[0].id | tostring else error("Missing valid unique lambda-release-receipt") end' "$RUNNER_TEMP/previous_receipt-pages.json")"
FOUND="$(jq -sre '[.[].artifacts[] | select(.name == "lambda-release-receipt")] | if length == 0 then "" elif length == 1 and .[0].expired == false then .[0].id | tostring else error("Missing valid unique lambda-release-receipt") end' "$RUNNER_TEMP/previous_receipt-pages.json")"
echo "artifact=${FOUND}" >> "$GITHUB_OUTPUT"
- name: Restore previous release receipt