Commit 50f3baf
Fix CI safety check to evaluate latest workflow attempt (#2062)
## Summary
Fixes the `ensure-master-docs-safety` GitHub Action to check the
**latest attempt** of workflow runs instead of the overall run
conclusion. This prevents false positives when workflows are manually
re-run and succeed.
## Problem
The safety check was blocking docs-only commits from skipping CI when
previous master commits had workflows marked as "failed", even if those
workflows had been successfully re-run. This happened because:
1. GitHub marks a workflow run as "failed" even after a manual rerun
succeeds
2. The `run.conclusion` field is never updated to "success" when reruns
succeed
3. The safety check was only looking at `run.conclusion`, not the actual
latest attempt
This created a situation where:
- Commit A fails a workflow
- The workflow is manually re-run and succeeds
- Commit B (docs-only) is blocked because commit A's workflow is still
marked as "failed"
- This continues indefinitely, blocking all subsequent commits
## Solution
Modified the action to:
1. Fetch the jobs for each workflow run via the GitHub API
2. Find the maximum `run_attempt` number to identify the latest attempt
3. Filter jobs to only those from the latest attempt
4. Check if any jobs in the **latest attempt** have failed conclusions
5. Only block docs-only commits if the latest attempt has actual
failures
This allows the safety check to correctly recognize when failures have
been resolved via manual reruns, while still preventing docs-only skips
when there are genuine unresolved failures.
## Test Plan
- [x] Code changes reviewed for correctness
- [x] Linting passes locally
- [ ] CI passes on this PR (will verify the fix works)
- [ ] After merge, verify that docs-only commits are no longer blocked
by previously-fixed workflow failures
🤖 Generated with [Claude Code](https://claude.com/claude-code)
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit
* **Chores**
* Improved the accuracy of documentation safety checks by enhancing how
workflow failures are detected and assessed, ensuring more precise
identification of build issues during the latest workflow attempts.
<sub>✏️ Tip: You can customize this high-level summary in your review
settings.</sub>
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
Co-authored-by: Claude <[email protected]>1 parent beb70f0 commit 50f3baf
1 file changed
+48
-13
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
70 | 70 | | |
71 | 71 | | |
72 | 72 | | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
73 | 77 | | |
74 | 78 | | |
75 | 79 | | |
| |||
100 | 104 | | |
101 | 105 | | |
102 | 106 | | |
103 | | - | |
104 | | - | |
105 | | - | |
106 | | - | |
107 | | - | |
108 | | - | |
109 | | - | |
110 | | - | |
111 | | - | |
112 | | - | |
113 | | - | |
114 | | - | |
115 | | - | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
116 | 151 | | |
117 | 152 | | |
118 | 153 | | |
| |||
0 commit comments