Fix failing GitHub Actions checks
Finds failing GitHub Actions checks on a PR with gh, pulls the logs, extracts the failure snippet and drafts a fix plan, changing code only after approval. Use when a PR's CI is red and you want the cause and a plan before any edit.
gh-fix-ci- Author
- OpenAI
- Source
- openai/skills/skills/.curated/gh-fix-ci @ 49f948f
- License
- Apache-2.0
About this skill
What it does
The skill takes the agent from a red pull request to an approved fix plan. It checks gh auth status, resolves the PR (current branch, number or URL) and runs scripts/inspect_pr_checks.py. The script keeps the failing checks (failure, cancelled, timed out, action required) and pulls each GitHub Actions run log with gh run view --log, or the job log through the API while the run is still in progress. It cuts a snippet around the last line that looks like an error (traceback, assert, panic, timeout and similar): up to 160 lines with 30 of context by default, set by --max-lines and --context. --json gives machine-readable output, and the exit code stays non-zero while failures remain. If gh rejects a field name, the script retries with the fields it lists as available.
Checks from other providers, such as Buildkite, are reported by URL only. The agent summarizes each failure with the check name, run URL and snippet, says when logs are missing, drafts a plan and changes code only after you approve it.
When to use it, and when not
Use it when GitHub Actions checks fail on a PR and you want the cause and a plan before any edit.
It does not push, rerun CI or loop until green.
How to run it
The install command below puts the whole folder in place: SKILL.md, the script, the icons, the Codex metadata file and the licence. You need Python 3 and the GitHub CLI logged in with repo and workflow scopes. To call it:
- Claude Code:
/gh-fix-ci, or ask for the skill by name. - Codex:
$gh-fix-ci. - Cursor: type
/in the Agent chat and pickgh-fix-ci.
Example: /gh-fix-ci PR 482 is red on the lint and test jobs. Find out why and show me a plan.
The plan step names a create-plan skill, which is not in our catalog; without it the agent writes the plan inline. OpenAI has marked openai/skills deprecated; our copy is pinned to a commit there, and as of November 2026 openai/plugins has no newer version of this skill.
How it differs from similar skills
Iterate a PR until CI is green fixes failures and review feedback on its own, commits, pushes and keeps polling until the actionable checks pass; this skill stops at a plan and waits for you. GitHub Actions CI writes and repairs the workflow files themselves. Log triage helps when the snippet is not enough and the full log needs reading.
Install
Run one command — it saves SKILL.md and the files it uses into your agent's skills folder. Claude Code and Codex pick up a new skill without a restart; if it does not show up, restart the agent.
curl -fsSL --create-dirs -o ~/.claude/skills/gh-fix-ci/SKILL.md https://anymodel.org/en/skills/openai/gh-fix-ci/SKILL.md -o ~/.claude/skills/gh-fix-ci/LICENSE.txt https://anymodel.org/en/skills/openai/gh-fix-ci/LICENSE.txt -o ~/.claude/skills/gh-fix-ci/agents/openai.yaml https://anymodel.org/en/skills/openai/gh-fix-ci/agents/openai.yaml -o ~/.claude/skills/gh-fix-ci/assets/github-small.svg https://anymodel.org/en/skills/openai/gh-fix-ci/assets/github-small.svg -o ~/.claude/skills/gh-fix-ci/assets/github.png https://anymodel.org/en/skills/openai/gh-fix-ci/assets/github.png -o ~/.claude/skills/gh-fix-ci/scripts/inspect_pr_checks.py https://anymodel.org/en/skills/openai/gh-fix-ci/scripts/inspect_pr_checks.py && chmod +x ~/.claude/skills/gh-fix-ci/scripts/inspect_pr_checks.py
curl -fsSL --create-dirs -o ~/.agents/skills/gh-fix-ci/SKILL.md https://anymodel.org/en/skills/openai/gh-fix-ci/SKILL.md -o ~/.agents/skills/gh-fix-ci/LICENSE.txt https://anymodel.org/en/skills/openai/gh-fix-ci/LICENSE.txt -o ~/.agents/skills/gh-fix-ci/agents/openai.yaml https://anymodel.org/en/skills/openai/gh-fix-ci/agents/openai.yaml -o ~/.agents/skills/gh-fix-ci/assets/github-small.svg https://anymodel.org/en/skills/openai/gh-fix-ci/assets/github-small.svg -o ~/.agents/skills/gh-fix-ci/assets/github.png https://anymodel.org/en/skills/openai/gh-fix-ci/assets/github.png -o ~/.agents/skills/gh-fix-ci/scripts/inspect_pr_checks.py https://anymodel.org/en/skills/openai/gh-fix-ci/scripts/inspect_pr_checks.py && chmod +x ~/.agents/skills/gh-fix-ci/scripts/inspect_pr_checks.py
foreach ($f in 'SKILL.md','LICENSE.txt','agents/openai.yaml','assets/github-small.svg','assets/github.png','scripts/inspect_pr_checks.py') { $p = Join-Path "$HOME\.claude\skills\gh-fix-ci" $f; New-Item -ItemType Directory -Force (Split-Path $p) | Out-Null; Invoke-WebRequest "https://anymodel.org/en/skills/openai/gh-fix-ci/$f" -UseBasicParsing -OutFile $p }foreach ($f in 'SKILL.md','LICENSE.txt','agents/openai.yaml','assets/github-small.svg','assets/github.png','scripts/inspect_pr_checks.py') { $p = Join-Path "$HOME\.agents\skills\gh-fix-ci" $f; New-Item -ItemType Directory -Force (Split-Path $p) | Out-Null; Invoke-WebRequest "https://anymodel.org/en/skills/openai/gh-fix-ci/$f" -UseBasicParsing -OutFile $p }Any other agent: save the file into its skills folder, or give it the link to the file: https://anymodel.org/en/skills/openai/gh-fix-ci/SKILL.md
SKILL.md
Gh Pr Checks Plan Fix
Overview
Use gh to locate failing PR checks, fetch GitHub Actions logs for actionable failures, summarize the failure snippet, then propose a fix plan and implement after explicit approval.
- If a plan-oriented skill (for example
create-plan) is available, use it; otherwise draft a concise plan inline and request approval before implementing.
Prereq: authenticate with the standard GitHub CLI once (for example, run gh auth login), then confirm with gh auth status (repo + workflow scopes are typically required).
Inputs
repo: path inside the repo (default.)pr: PR number or URL (optional; defaults to current branch PR)ghauthentication for the repo host
Quick start
python "<path-to-skill>/scripts/inspect_pr_checks.py" --repo "." --pr "<number-or-url>"- Add
--jsonif you want machine-friendly output for summarization.
Workflow
- Verify gh authentication.
- Run
gh auth statusin the repo. - If unauthenticated, ask the user to run
gh auth login(ensuring repo + workflow scopes) before proceeding.
- Run
- Resolve the PR.
- Prefer the current branch PR:
gh pr view --json number,url. - If the user provides a PR number or URL, use that directly.
- Prefer the current branch PR:
- Inspect failing checks (GitHub Actions only).
- Preferred: run the bundled script (handles gh field drift and job-log fallbacks):
python "<path-to-skill>/scripts/inspect_pr_checks.py" --repo "." --pr "<number-or-url>"- Add
--jsonfor machine-friendly output.
- Manual fallback:
gh pr checks <pr> --json name,state,bucket,link,startedAt,completedAt,workflow- If a field is rejected, rerun with the available fields reported by
gh.
- If a field is rejected, rerun with the available fields reported by
- For each failing check, extract the run id from
detailsUrland run:gh run view <run_id> --json name,workflowName,conclusion,status,url,event,headBranch,headShagh run view <run_id> --log
- If the run log says it is still in progress, fetch job logs directly:
gh api "/repos/<owner>/<repo>/actions/jobs/<job_id>/logs" > "<path>"
- Preferred: run the bundled script (handles gh field drift and job-log fallbacks):
- Scope non-GitHub Actions checks.
- If
detailsUrlis not a GitHub Actions run, label it as external and only report the URL. - Do not attempt Buildkite or other providers; keep the workflow lean.
- If
- Summarize failures for the user.
- Provide the failing check name, run URL (if any), and a concise log snippet.
- Call out missing logs explicitly.
- Create a plan.
- Use the
create-planskill to draft a concise plan and request approval.
- Use the
- Implement after approval.
- Apply the approved plan, summarize diffs/tests, and ask about opening a PR.
- Recheck status.
- After changes, suggest re-running the relevant tests and
gh pr checksto confirm.
- After changes, suggest re-running the relevant tests and
Bundled Resources
scripts/inspect_pr_checks.py
Fetch failing PR checks, pull GitHub Actions logs, and extract a failure snippet. Exits non-zero when failures remain so it can be used in automation.
Usage examples:
python "<path-to-skill>/scripts/inspect_pr_checks.py" --repo "." --pr "123"python "<path-to-skill>/scripts/inspect_pr_checks.py" --repo "." --pr "https://github.com/org/repo/pull/123" --jsonpython "<path-to-skill>/scripts/inspect_pr_checks.py" --repo "." --max-lines 200 --context 40
Connect through AnyModel API
This skill runs on whatever model your agent uses. Point Claude Code, Codex or Cursor at AnyModel to run it on Claude, GPT, Gemini and more with one key — pay per token, no subscription.
AnyModel