GitHub CI fix
Use fix_github_pr_ci to repair failing checks on a pull request or a named
branch.
When to use
- The user asks to fix failing CI, broken GitHub Actions checks, failing PR
checks, a red pull request branch, or CI on a named branch such as
main. - The user says "fix CI on this PR", "fix the CI of PR 123 and push", "repair the failing checks on owner/repo#123", or provides a GitHub pull request URL and asks for CI/check fixes.
- The user asks to fix failing CI on a branch itself — "fix the CI on main", "main is red, fix it", or "fix CI on the default branch and push" — with no PR involved.
Related workflows
- Ordinary PR reads, comments, closes, merges, labels, or issue work. Use
github_cli. - Security alert remediation. Use
fix_github_security_alert.
Workflow rules
- For a GitHub PR URL, call:
fix_github_pr_ci(pr_url="<url>") - For
owner/repo#123or "PR 123 in owner/repo", call:fix_github_pr_ci(owner="owner", repo="repo", pr_number=123) - For "fix the CI on main" (or any named branch with no PR), call:
fix_github_pr_ci(branch="main")Never passbranchtogether with a PR selector, and never invent a branch the user did not name. - If no owner/repo is named, omit both and let the tool use the current checkout's GitHub origin.
- Never use
github_cliorshell_runto run rawgh pr checks,gh run view, checkout, commit, or push for this workflow. The CI fixer owns PR metadata, failing-check log inspection, fix execution, branch safety, commit, and push. - The tool pushes to the existing PR head branch after approval. Do not ask the user whether to open a new PR.
- A PR that is behind its base branch, or conflicts with it (GitHub shows it
as not mergeable and starts no checks), is handled by the tool: it merges the
base branch into the PR branch, resolves conflicts, regenerates lockfiles,
pushes, and waits for the checks — also when the conflict only appears after
its own push. Never run
git merge,git rebase, or conflict edits around it. If it reports blocked files, relay that one line and stop. - For branch targets such as
main, the tool creates a separate linked git worktree, commits on a freshopensre/ci-fix-*branch, and pushes that branch. It never pushes directly to protected branches. - If the tool returns
response_text, output exactly that text and stop. - If
error_kindis set, reply in one short line fromerror. Do not say "next steps", do not add numbered options, do not list example commands, and do not ask a broad follow-up question.
Examples
"fix CI on https://github.com/Tracer-Cloud/opensre/pull/4597 and push"
fix_github_pr_ci(pr_url="https://github.com/Tracer-Cloud/opensre/pull/4597")"fix failing checks on Tracer-Cloud/opensre#4597"
fix_github_pr_ci(owner="Tracer-Cloud", repo="opensre", pr_number=4597)"fix CI on main in Tracer-Cloud/opensre and push"
fix_github_pr_ci(owner="Tracer-Cloud", repo="opensre", branch="main")"the current PR CI is failing, fix and push"
fix_github_pr_ci()"fix the CI on main"
fix_github_pr_ci(branch="main")