Commit 464dca5
Fix docs-only CI check to allow running workflows (#2073)
## Summary
Fixes the circular dependency issue where docs-only commits to master
were blocked whenever the previous commit had ANY running workflows,
even if they hadn't failed yet.
## Problem
The `ensure-master-docs-safety` action was **too conservative** - it
blocked docs-only commits whenever the previous master commit had
workflows still running, creating bottlenecks:
1. Commit A merges → triggers workflows (e.g., integration tests, Pro
tests)
2. Commit B (docs-only) tries to merge while Commit A's workflows are
still running
3. Safety check blocks Commit B with error: "Cannot skip CI for
docs-only commit because previous master commit still has running
workflows"
4. This creates a bottleneck - docs changes must wait for all previous
workflows to complete
**Real example from screenshot:**
```
Error: Cannot skip CI for docs-only commit because previous master commit 3758d1a still has running workflows:
- React on Rails Pro - Integration Tests #988 is still in_progress
- Integration Tests #202 is still in_progress
```
## Solution
Changed the logic to:
- ✅ **Allow docs-only skips when workflows are running** (they haven't
failed yet)
- ✅ **Block only if completed workflows have actually failed**
(maintains safety)
- ✅ **Add informative logging** about running vs failed workflows
## Rationale
- **Running ≠ Failing**: Workflows that are still running haven't failed
yet, so there's no known issue to block on
- **Independent validation**: Running workflows will complete and
validate the previous commit independently
- **Eliminates bottleneck**: No more waiting for slow integration tests
to finish before docs can merge
- **Maintains safety**: Still blocks if completed workflows have
actually failed
## Changes
**Before:**
```javascript
const incompleteRuns = Array.from(latestByWorkflow.values()).filter(
(run) => run.status !== 'completed'
);
if (incompleteRuns.length > 0) {
core.setFailed(/* Block the docs-only commit */);
return; // Stop checking
}
```
**After:**
```javascript
const incompleteRuns = Array.from(latestByWorkflow.values()).filter(
(run) => run.status !== 'completed'
);
if (incompleteRuns.length > 0) {
core.info(/* Log that we're allowing it */);
// Continue to check COMPLETED workflows for failures
}
// Only check completed workflows for failures
const completedRuns = Array.from(latestByWorkflow.values()).filter(
(run) => run.status === 'completed'
);
for (const run of completedRuns) {
// Check if failed...
}
```
## Testing
- Logic verified to ensure safety is maintained (still blocks on actual
failures)
- Prettier formatting verified
- Will be validated by the next docs-only merge to master
## Impact
- Docs-only commits can now merge immediately, even if previous
workflows are slow
- No more false-positive blocks from in-progress workflows
- Safety maintained - actual failures still block docs-only skips
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-authored-by: Claude <[email protected]>1 parent 9383537 commit 464dca5
1 file changed
+23
-11
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
83 | 83 | | |
84 | 84 | | |
85 | 85 | | |
86 | | - | |
87 | | - | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
88 | 92 | | |
89 | 93 | | |
90 | 94 | | |
| |||
93 | 97 | | |
94 | 98 | | |
95 | 99 | | |
96 | | - | |
| 100 | + | |
97 | 101 | | |
98 | | - | |
| 102 | + | |
99 | 103 | | |
100 | 104 | | |
101 | | - | |
| 105 | + | |
102 | 106 | | |
103 | 107 | | |
104 | | - | |
| 108 | + | |
105 | 109 | | |
106 | 110 | | |
107 | | - | |
| 111 | + | |
108 | 112 | | |
109 | 113 | | |
| 114 | + | |
110 | 115 | | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
111 | 119 | | |
112 | | - | |
| 120 | + | |
113 | 121 | | |
114 | 122 | | |
115 | 123 | | |
| |||
121 | 129 | | |
122 | 130 | | |
123 | 131 | | |
124 | | - | |
125 | | - | |
| 132 | + | |
| 133 | + | |
126 | 134 | | |
127 | 135 | | |
128 | 136 | | |
| |||
150 | 158 | | |
151 | 159 | | |
152 | 160 | | |
153 | | - | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
154 | 166 | | |
155 | 167 | | |
156 | 168 | | |
| |||
0 commit comments