fix-ci-until-green
Fix CI Until Green
Take a red GitHub Actions run and iterate until it is green: read every failure, form root-cause hypotheses, get the plan critiqued, fix, commit, push, read the next run. Repeat.
Optimise for the fewest CI runs, not the smallest diff. Every push spends real runner time, so each iteration should try to fix everything wrong with the branch — including failures that are still hidden behind the ones CI reported.
Hard cap: 10 iterations. Report and hand control back when the cap is reached.
Prerequisites
The scripts enforce the mechanical checks themselves and say what is wrong on stderr: missing
gh/jq, an unauthenticated gh (keyring or GH_TOKEN/GITHUB_TOKEN), and a checkout whose
remotes do not point at the run's repository. Exit 3 with such a message means fix the
invocation or the working copy — do not pre-run gh auth status, jq --version, or
git remote -v by hand.