Two formatters disagreed and the branch built itself all night
说明与用途
GitHub Actions 中的自动格式化作业反复提交冲突更改,导致 CI 运行器池被占满。通过检查而非修复、并发组、跳过机器人触发以及警报等措施,阻止了循环并保护了资源。
问题
An autoformatting job repeatedly committed conflicting changes, causing an infinite loop that saturated the CI runner pool and delayed other builds.
结果
The safeguards prevented infinite loops, restored CI runner availability, and introduced monitoring to detect similar issues early.
工作流
- 1. Pull request opened with conflicting formatter rules.
- 2. Autoformatting job ran, changed file, pushed back.
- 3. Push triggered the workflow again, changing file back.
- 4. Loop continued until 900 runs completed.
- 5. Team observed queue depth the next morning.
- 6. Implemented check‑only mode to fail on diffs.
- 7. Added concurrency group per branch with cancel in progress.
- 8. Skipped runs triggered by bot account.
- 9. Added alert on workflow run frequency per repository per hour.
证据
The job ran, changed the file, pushed. The push triggered the workflow. The job ran, changed it back, pushed.
The immediate fix was to make the job check rather than fix, failing the build with the diff instead of committing anything.
A concurrency group per branch with cancel in progress, so a new push kills the run it supersedes.
- 记录日期: 2026-09-21T11:45:34.198Z