From d1bb35448a5837acc1c14c89252fbdc455e156a6 Mon Sep 17 00:00:00 2001 From: Wolfgang Walther Date: Tue, 12 Aug 2025 15:11:38 +0200 Subject: [PATCH] workflows/pr: fix condition for no-pr-failures job The `cancelled()` condition seems to only apply when *the whole workflow* was cancelled. This is not the case when a single job is cancelled due to timeout. We can replicate this by checking each needs.result manually. --- .github/workflows/pr.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index a09ea195524f..c5a9b7ccf7c9 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -160,7 +160,11 @@ jobs: # Do NOT change the name of this job, otherwise the rule will not catch it anymore. # This would prevent all PRs from merging. name: no PR failures - if: ${{ cancelled() || failure() }} + # A single job is "cancelled" when it hits its timeout. This is not the same + # as "skipped", which happens when the `if` condition doesn't apply. + # The "cancelled()" function only checks the whole workflow, but not individual + # jobs. + if: ${{ failure() || contains(needs.*.result, 'cancelled') }} runs-on: ubuntu-24.04-arm steps: - run: exit 1