Skip to content

Commit 6585876

Browse files
Saadnajmiclaude
andauthored
Fix PR gate job to fail when upstream jobs fail (#4091)
* Fix PR gate job to fail instead of skip when upstream jobs fail The `pr` gate job is the only required status check for merging. Without `if: always()`, when any dependency job fails, the gate job gets skipped — and GitHub treats skipped as passing, allowing PRs with failing checks to be merged (e.g. #4087). This adds `if: always()` so the gate job always runs, and an explicit check that fails the job when any dependency failed or was cancelled. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * [Testing] break a snapshot * Update Button.test.tsx.snap --------- Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
1 parent db5fc0a commit 6585876

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

.github/workflows/pr.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -385,6 +385,7 @@ jobs:
385385
386386
pr:
387387
name: PR
388+
if: always()
388389
runs-on: ubuntu-latest
389390
needs:
390391
- js
@@ -398,5 +399,10 @@ jobs:
398399
- publish-dry-run
399400
- test-links
400401
steps:
402+
- name: Check for failures or cancellations
403+
if: ${{ contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled') }}
404+
run: |
405+
echo "One or more required jobs failed or were cancelled."
406+
exit 1
401407
- name: All required jobs passed
402-
run: echo "All required jobs completed."
408+
run: echo "All required jobs completed successfully."

0 commit comments

Comments
 (0)