Skip to content

Commit 8e6d01f

Browse files
Saadnajmiclaude
andauthored
fix(ci): ensure PR gate job fails instead of skipping when upstream jobs fail (#2926)
## Summary - The `PR` gate job is the required status check for merging - Without `if: always()`, when any dependency job fails, the gate job gets **skipped** — and GitHub treats `SKIPPED` as passing for required checks, allowing PRs with failing CI to merge - Adds `if: always()` so the gate job always runs, plus an explicit check that fails when any dependency failed or was cancelled ## Test plan - [ ] Verify that when all jobs pass, the `PR` gate job still passes - [ ] Verify that when any job fails, the `PR` gate job now **fails** instead of being skipped 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 34ca616 commit 8e6d01f

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

.github/workflows/microsoft-pr.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,7 @@ jobs:
159159

160160
PR:
161161
name: "PR"
162+
if: always()
162163
permissions: {}
163164
runs-on: ubuntu-latest
164165
needs:
@@ -172,5 +173,10 @@ jobs:
172173
- test-react-native-macos-init
173174
# - react-native-test-app-integration
174175
steps:
176+
- name: Check for failures or cancellations
177+
if: ${{ contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled') }}
178+
run: |
179+
echo "One or more required jobs failed or were cancelled."
180+
exit 1
175181
- name: All required jobs passed
176-
run: echo "All required jobs completed."
182+
run: echo "All required jobs completed successfully."

0 commit comments

Comments
 (0)