From fa7a86fa66e9985c8f98115f779aeb8c9f16e35e Mon Sep 17 00:00:00 2001 From: Ray Morris Date: Thu, 20 Aug 2026 10:16:45 -0500 Subject: [PATCH] Don't gate baseline publish on Build pre-release's overall conclusion MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The Release job (nightly upload to iNavFlight/inav-nightly) can fail for reasons unrelated to the build itself and drags the whole run's conclusion to failure even when the build succeeded and produced the size-report/branch-name artifacts. Confirmed live: the 2026-08-20 push to release/9.1 had every build job succeed but Release fail with "Bad credentials" (NIGHTLY_TOKEN), so publish-baseline never ran and no baseline has ever been published — which is why PR #11800 still shows "No size baseline is available yet". Check the specific build/upload-artifacts job's conclusion instead of the aggregate run conclusion. --- .github/workflows/ci-size-report.yml | 39 +++++++++++++++++++++++++--- 1 file changed, 36 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci-size-report.yml b/.github/workflows/ci-size-report.yml index 2af5c76d1f1..9f8122bff77 100644 --- a/.github/workflows/ci-size-report.yml +++ b/.github/workflows/ci-size-report.yml @@ -37,15 +37,46 @@ jobs: runs-on: ubuntu-latest if: > github.event.workflow_run.name == 'Build pre-release' && - github.event.workflow_run.event == 'push' && - github.event.workflow_run.conclusion == 'success' + github.event.workflow_run.event == 'push' concurrency: group: size-baseline-${{ github.event.workflow_run.head_branch }} cancel-in-progress: true permissions: - actions: read # to download artifacts from the triggering workflow run + actions: read # to download artifacts and query job conclusions from the triggering workflow run steps: + # Don't gate on github.event.workflow_run.conclusion: "Build + # pre-release" also runs a separate Release job (nightly upload to + # iNavFlight/inav-nightly) that can fail for reasons unrelated to the + # build itself (e.g. an expired NIGHTLY_TOKEN) and drags the whole + # run's conclusion to failure even when the build succeeded and + # produced the artifacts we actually need. Check the specific job + # that produces them instead. + - name: Check build job succeeded + id: check + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + RUN_ID: ${{ github.event.workflow_run.id }} + run: | + CONCLUSION=$(gh api "repos/${{ github.repository }}/actions/runs/${RUN_ID}/jobs" --paginate \ + --jq '.jobs[] | select(.name == "build / upload-artifacts") | .conclusion') + if [ -z "$CONCLUSION" ]; then + # Job not found at all usually means the caller/callee job names + # changed (e.g. nightly-build.yml's "build" job or ci.yml's + # "upload-artifacts" job got renamed) — that's a workflow + # structure mismatch, not an expected build failure, and is + # exactly the kind of thing that silently broke baseline + # publishing before. Warn louder than a plain failed build. + echo "::warning::build / upload-artifacts job not found in run ${RUN_ID} — job name may have changed, skipping baseline publish" + echo "proceed=false" >> "$GITHUB_OUTPUT" + elif [ "$CONCLUSION" != "success" ]; then + echo "::notice::build / upload-artifacts did not succeed (conclusion: ${CONCLUSION}), skipping baseline publish" + echo "proceed=false" >> "$GITHUB_OUTPUT" + else + echo "proceed=true" >> "$GITHUB_OUTPUT" + fi + - name: Download size report + if: steps.check.outputs.proceed == 'true' uses: actions/download-artifact@v4 with: name: size-report @@ -53,6 +84,7 @@ jobs: github-token: ${{ secrets.GITHUB_TOKEN }} - name: Download branch name + if: steps.check.outputs.proceed == 'true' uses: actions/download-artifact@v4 with: name: branch-name @@ -60,6 +92,7 @@ jobs: github-token: ${{ secrets.GITHUB_TOKEN }} - name: Publish baseline + if: steps.check.outputs.proceed == 'true' env: GH_TOKEN: ${{ secrets.PR_BUILDS_TOKEN }} run: |