From 7ab6fb39e81e8434ba9955c3085517d73a80e851 Mon Sep 17 00:00:00 2001 From: Joseph Mearman Date: Wed, 25 Nov 2026 08:20:30 +0000 Subject: [PATCH] fix(ci): wait for the Pages artifact to be listed before deploying deploy-pages looks the artifact up through the Actions results service straight after upload-pages-artifact finalises it. On two consecutive main runs that listing returned only the earlier coverage and Playwright artifacts, so the deploy failed with "No artifacts named github-pages were found" although the REST API listed the artifact moments later. Poll the run's artifact list until github-pages appears, bounded so a genuinely missing artifact still fails the job. --- .github/workflows/ci.yml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3e36df064..defae21e1 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1067,6 +1067,21 @@ jobs: - uses: actions/upload-pages-artifact@v5 with: path: packages/web/dist + # deploy-pages lists the run's artifacts through the Actions results service immediately after the upload finalises, and that listing can lag the finalise: two main runs failed with "No artifacts named github-pages were found" although the artifact was finalised a few hundred milliseconds earlier and is listed by the REST API afterwards. Wait until the run lists it before deploy-pages looks it up. The bound only stops a genuinely missing artifact from hanging the job, in which case deploy-pages reports the real failure. + - name: Wait until the uploaded github-pages artifact is listed + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + for attempt in $(seq 1 30); do + count=$(gh api "repos/${{ github.repository }}/actions/runs/${{ github.run_id }}/artifacts" \ + --jq '[.artifacts[] | select(.name=="github-pages" and .expired==false)] | length') + if [ "$count" = "1" ]; then + exit 0 + fi + sleep 2 + done + echo "github-pages artifact still not listed after 30 attempts" >&2 + exit 1 - id: deployment uses: actions/deploy-pages@v5