diff --git a/.agents/skills/authoring-ci-workflows/SKILL.md b/.agents/skills/authoring-ci-workflows/SKILL.md index b5a6f01ec7c2..ce91694253ec 100644 --- a/.agents/skills/authoring-ci-workflows/SKILL.md +++ b/.agents/skills/authoring-ci-workflows/SKILL.md @@ -105,6 +105,12 @@ Adding another predicate can skip the required check, so `always() && > "$GITHUB_ENV" - name: Check results run: | + if [[ "${RUN_CANCELLED:-}" == "true" ]]; then + echo "Run was cancelled (superseded); not treating it as a failure." + exit 0 + fi if [[ "${{ needs.changes.result }}" != "success" && "${{ needs.changes.result }}" != "skipped" ]]; then echo "Change detection did not succeed (result: ${{ needs.changes.result }})." exit 1 diff --git a/.github/workflows/desktop-ci.yml b/.github/workflows/desktop-ci.yml index fe20eb20e8bd..00a05ba956b4 100644 --- a/.github/workflows/desktop-ci.yml +++ b/.github/workflows/desktop-ci.yml @@ -98,8 +98,19 @@ jobs: runs-on: depot-ubuntu-24.04 timeout-minutes: 5 steps: + # A superseded run (cancel-in-progress) cancels its jobs. That is not a + # test failure, so note it and let the check below pass instead of + # posting a red required check. cancelled() is true only for a whole-run + # cancel, so a job-level cancel or timeout still reaches the guards. + - name: Note run cancellation + if: ${{ cancelled() }} + run: echo "RUN_CANCELLED=true" >> "$GITHUB_ENV" - name: Check results run: | + if [[ "${RUN_CANCELLED:-}" == "true" ]]; then + echo "Run was cancelled (superseded); not treating it as a failure." + exit 0 + fi if [[ "${{ needs.build.result }}" != "success" && "${{ needs.build.result }}" != "skipped" ]]; then echo "Desktop build did not succeed (result: ${{ needs.build.result }})." exit 1 diff --git a/.github/workflows/desktop-quality.yml b/.github/workflows/desktop-quality.yml index d50a318a8c91..5fd1b3a0037b 100644 --- a/.github/workflows/desktop-quality.yml +++ b/.github/workflows/desktop-quality.yml @@ -105,8 +105,19 @@ jobs: timeout-minutes: 5 if: always() steps: + # A superseded run (cancel-in-progress) cancels its jobs. That is not a + # test failure, so note it and let the check below pass instead of + # posting a red required check. cancelled() is true only for a whole-run + # cancel, so a job-level cancel or timeout still reaches the guards. + - name: Note run cancellation + if: ${{ cancelled() }} + run: echo "RUN_CANCELLED=true" >> "$GITHUB_ENV" - name: Check results run: | + if [[ "${RUN_CANCELLED:-}" == "true" ]]; then + echo "Run was cancelled (superseded); not treating it as a failure." + exit 0 + fi if [[ "${{ needs.changes.result }}" != "success" && "${{ needs.changes.result }}" != "skipped" ]]; then echo "Change detection did not succeed (result: ${{ needs.changes.result }})." exit 1 diff --git a/.github/workflows/desktop-test.yml b/.github/workflows/desktop-test.yml index c8e40f903503..07a04a41c7ca 100644 --- a/.github/workflows/desktop-test.yml +++ b/.github/workflows/desktop-test.yml @@ -351,8 +351,19 @@ jobs: timeout-minutes: 5 if: always() steps: + # A superseded run (cancel-in-progress) cancels its jobs. That is not a + # test failure, so note it and let the check below pass instead of + # posting a red required check. cancelled() is true only for a whole-run + # cancel, so a job-level cancel or timeout still reaches the guards. + - name: Note run cancellation + if: ${{ cancelled() }} + run: echo "RUN_CANCELLED=true" >> "$GITHUB_ENV" - name: Check results run: | + if [[ "${RUN_CANCELLED:-}" == "true" ]]; then + echo "Run was cancelled (superseded); not treating it as a failure." + exit 0 + fi if [[ "${{ needs.changes.result }}" != "success" && "${{ needs.changes.result }}" != "skipped" ]]; then echo "Change detection did not succeed (result: ${{ needs.changes.result }})." exit 1 diff --git a/.github/workflows/desktop-typecheck.yml b/.github/workflows/desktop-typecheck.yml index dac3195610d3..7466517cfe04 100644 --- a/.github/workflows/desktop-typecheck.yml +++ b/.github/workflows/desktop-typecheck.yml @@ -124,8 +124,19 @@ jobs: timeout-minutes: 5 if: always() steps: + # A superseded run (cancel-in-progress) cancels its jobs. That is not a + # test failure, so note it and let the check below pass instead of + # posting a red required check. cancelled() is true only for a whole-run + # cancel, so a job-level cancel or timeout still reaches the guards. + - name: Note run cancellation + if: ${{ cancelled() }} + run: echo "RUN_CANCELLED=true" >> "$GITHUB_ENV" - name: Check results run: | + if [[ "${RUN_CANCELLED:-}" == "true" ]]; then + echo "Run was cancelled (superseded); not treating it as a failure." + exit 0 + fi if [[ "${{ needs.changes.result }}" != "success" && "${{ needs.changes.result }}" != "skipped" ]]; then echo "Change detection did not succeed (result: ${{ needs.changes.result }})." exit 1