← ClaudeAtlas

fix-ci-failureslisted

Investigate and fix CI failures on a pull request. Use when CI checks fail on a PR branch — covers finding the PR, identifying failed checks, downloading logs and artifacts, extracting the failure cause, and iterating on a fix. Requires the `gh` CLI.
Pointa-Labs/basehalf · ★ 15 · AI & Automation · score 73
Install: claude install-skill Pointa-Labs/basehalf
# Investigating and Fixing CI Failures This skill guides you through diagnosing and fixing CI failures on a PR using the `gh` CLI. The user has the PR branch checked out locally. ## Workflow Overview 1. Identify the current branch and its PR 2. Check CI status and find failed checks 3. Download logs for failed jobs 4. Extract and understand the failure 5. Fix the issue and push --- ## Step 1: Identify the Branch and PR ```bash # Get the current branch name git branch --show-current # Find the PR for this branch gh pr view --json number,title,url,statusCheckRollup ``` If no PR is found, the user may need to specify the PR number. --- ## Step 2: Check CI Status ```bash # List all checks and their status (pass/fail/pending) gh pr checks --json name,state,link,bucket # Filter to only failed checks gh pr checks --json name,state,link,bucket --jq '.[] | select(.bucket == "fail")' ``` The `link` field contains the URL to the GitHub Actions job. Extract the **run ID** from the URL — it's the number after `/runs/`: ``` https://github.com/microsoft/vscode/actions/runs/<RUN_ID>/job/<JOB_ID> ``` If checks are still `IN_PROGRESS`, wait for them to complete before downloading logs: ```bash gh pr checks --watch --fail-fast ``` --- ## Step 3: Get Failed Job Details ```bash # List failed jobs in a run (use the run ID from the check link) gh run view <RUN_ID> --json jobs --jq '.jobs[] | select(.conclusion == "failure") | {name: .name, id: .databaseId}' ``` --- ## Step 4: Dow