Fix PR Until Green
Repair existing PR CI failures until actionable checks pass or a blocker remains.
UTILITY SKILL. INVOKES: gh, git, targeted local verification, github:gh-fix-ci, repair-pr-ci-trigger for empty CI trigger commits. FOR EXISTING PRS ONLY.
Read CI repair loop before changing code.
USE FOR:
- "get this PR green"
- "fix the CI actions for this PR"
- "keep repairing failing checks on PR #123"
- "debug GitHub Actions failures until checks pass"
DO NOT USE FOR:
- Creating, publishing, or marking a draft PR ready; use
draft-pr-for-branch or draft-pr-until-green.
- Monitoring without code repair; use
monitor-ci or monitor.
- Missing secrets, quota, infrastructure outages, or failures unrelated to the branch diff.
Examples:
- "Get PR #42 green" means inspect that PR, repair actionable CI, and trigger GitHub Actions with an empty
#CI commit when needed because the prompt explicitly requested a green CI outcome.
- "Open a draft PR, then monitor CI" belongs to
draft-pr-until-green.
Workflow
- Resolve the existing PR and head SHA with
gh pr view.
- Inspect checks with
gh pr checks; use bounded polling if pending.
- If CI has not run for the latest head, use
repair-pr-ci-trigger to create an empty #CI trigger commit on the PR branch.
- Read failed Actions logs before editing and identify the exact command, file, assertion, or stack trace.
- Make the smallest branch-caused repair batch, run only targeted local verification that directly matches the repair, commit and push code without
#CI, then create an empty #CI trigger commit when Actions need to run again.
- Stop when checks are green or the remaining failure is non-actionable.
Troubleshooting
- Stop after two repair rounds without meaningful progress.
- Preserve draft state, review state, and PR scope; never auto-merge, rebase, or replace the PR.
Output
Report PR link, final head SHA, checks fixed, local verification, green or blocked state, and remaining blockers.
1---2name: fix-pr-until-green3description: Repair an existing pull request's failing GitHub Actions checks until actionable CI passes or a blocker remains. Use when the user explicitly asks to get an existing PR green, fix CI on this PR, repair failing actions until green, run GitHub Actions repair, or keep debugging checks. Do not use to create or publish a new PR, or for ordinary commits that do not request Actions.4---56# Fix PR Until Green78Repair existing PR CI failures until actionable checks pass or a blocker remains.910**UTILITY SKILL. INVOKES:** `gh`, git, targeted local verification, `github:gh-fix-ci`, `repair-pr-ci-trigger` for empty CI trigger commits. **FOR EXISTING PRS ONLY.**1112Read [CI repair loop](references/ci-repair-loop.md) before changing code.1314## USE FOR:1516- "get this PR green"17- "fix the CI actions for this PR"18- "keep repairing failing checks on PR #123"19- "debug GitHub Actions failures until checks pass"2021## DO NOT USE FOR:2223- Creating, publishing, or marking a draft PR ready; use `draft-pr-for-branch` or `draft-pr-until-green`.24- Monitoring without code repair; use `monitor-ci` or `monitor`.25- Missing secrets, quota, infrastructure outages, or failures unrelated to the branch diff.2627## Examples:2829- "Get PR #42 green" means inspect that PR, repair actionable CI, and trigger GitHub Actions with an empty `#CI` commit when needed because the prompt explicitly requested a green CI outcome.30- "Open a draft PR, then monitor CI" belongs to `draft-pr-until-green`.3132## Workflow33341. Resolve the existing PR and head SHA with `gh pr view`.352. Inspect checks with `gh pr checks`; use bounded polling if pending.363. If CI has not run for the latest head, use `repair-pr-ci-trigger` to create an empty `#CI` trigger commit on the PR branch.374. Read failed Actions logs before editing and identify the exact command, file, assertion, or stack trace.385. Make the smallest branch-caused repair batch, run only targeted local verification that directly matches the repair, commit and push code without `#CI`, then create an empty `#CI` trigger commit when Actions need to run again.396. Stop when checks are green or the remaining failure is non-actionable.4041## Troubleshooting4243- Stop after two repair rounds without meaningful progress.44- Preserve draft state, review state, and PR scope; never auto-merge, rebase, or replace the PR.4546## Output4748Report PR link, final head SHA, checks fixed, local verification, green or blocked state, and remaining blockers.