GitHub PR Workflows
Tools for managing GitHub PRs using the gh CLI. Covers CI debugging and review comment handling.
Prerequisites
gh auth status # Verify authenticated (repo + workflow scopes)
# If not: gh auth login
Part 1: Fix Failing CI Checks
Debug and fix failing GitHub Actions checks on a PR.
Quick Start
python "<path-to-skill>/scripts-ci/inspect_pr_checks.py" --repo "." --pr "<number-or-url>"
# Add --json for machine-friendly output
Workflow
- Resolve the PR —
gh pr view --json number,url(current branch) or use provided PR number - Inspect failing checks (GitHub Actions only):
- Preferred: run the bundled script (handles field drift and job-log fallbacks)
- Manual fallback:
gh pr checks <pr> --json name,state,bucket,link,startedAt,completedAt,workflow gh run view <run_id> --log
- Scope external checks — If
detailsUrlis not GitHub Actions, report the URL only. Don't attempt Buildkite or other providers. - Summarize failures — Check name, run URL, concise log snippet. Call out missing logs.
- Create a fix plan — Draft concise plan, request approval before implementing.
- Implement after approval — Apply fixes, summarize diffs/tests.
- Recheck —
gh pr checksto confirm.
Bundled Scripts
scripts-ci/inspect_pr_checks.py— Fetch failing checks, pull GitHub Actions logs, extract failure snippets. Exits non-zero when failures remain.python "<path-to-skill>/scripts-ci/inspect_pr_checks.py" --repo "." --pr "123" --json python "<path-to-skill>/scripts-ci/inspect_pr_checks.py" --repo "." --max-lines 200 --context 40
Part 2: Address PR Review Comments
Find the open PR for the current branch and address its review comments.
Workflow
- Fetch comments — Run
scripts-comments/fetch_comments.pyto print all comments and review threads - Present to user — Number all threads with a short summary of what each fix requires
- User selects which comments to address
- Apply fixes for selected comments
Bundled Scripts
scripts-comments/fetch_comments.py— Print all comments and review threads on the PR
Notes
- If
ghhits auth/rate issues mid-run, prompt user to re-authenticate withgh auth login, then retry.