Skip to content

Commit f8912ed

Browse files
fix: prevent cancelled jobs from passing result checks (#464)
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent d4aaed4 commit f8912ed

3 files changed

Lines changed: 6 additions & 4 deletions

File tree

‎.github/workflows/analysis.yml‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,6 @@ jobs:
133133
if: always()
134134
runs-on: ubuntu-24.04
135135
steps:
136-
- if: contains(needs.*.result, 'failure')||contains(needs.*.result, 'canceled')
137-
run: echo "At least one job has failed." && exit 1
136+
- if: contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled')
137+
run: echo "At least one job has failed or was cancelled." && exit 1
138138
- run: echo "Success!"

‎.github/workflows/pr-open.yml‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,6 @@ jobs:
6262
if: always()
6363
runs-on: ubuntu-24.04
6464
steps:
65-
- if: contains(needs.*.result, 'failure')||contains(needs.*.result, 'canceled')
66-
run: echo "At least one job has failed." && exit 1
65+
- if: contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled')
66+
run: echo "At least one job has failed or was cancelled." && exit 1
6767
- run: echo "Success!"

‎.github/workflows/pr-validate.yml‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,6 @@ jobs:
2626
needs: [validate]
2727
runs-on: ubuntu-24.04
2828
steps:
29+
- if: contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled')
30+
run: echo "Validation failed or was cancelled." && exit 1
2931
- run: echo "Success!"

0 commit comments

Comments
 (0)