mirror of
https://github.com/CHN-beta/nixpkgs.git
synced 2026-01-12 02:40:31 +08:00
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.
(cherry picked from commit d1bb35448a)
This commit is contained in:
committed by
github-actions[bot]
parent
c1f49d44d4
commit
3bc8302a6a
6
.github/workflows/pr.yml
vendored
6
.github/workflows/pr.yml
vendored
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user