
Fix Ci Failures
Diagnose failing GitHub Actions checks on your PR branch with gh, pull logs, fix the root cause, and push until CI is green.
Install
npx skills add https://github.com/microsoft/vscode --skill fix-ci-failuresWhat is this skill?
- Five-step workflow: branch/PR discovery, check rollup, log download, failure extraction, fix and push
- Uses gh pr view, gh pr checks, and GitHub Actions run IDs from check links
- Handles in-progress checks with wait-before-download guidance
- Assumes PR branch is checked out locally for fast iteration
- Requires GitHub CLI (gh) authenticated for the target repo
Adoption & trust: 125 installs on skills.sh; 186k GitHub stars; 2/3 security scanners passed (skills.sh audits).
Recommended Skills
Azure Kubernetesmicrosoft/azure-skills
Github Actions Docsxixu-me/skills
Deploy To Vercelvercel-labs/agent-skills
Vercel Cli With Tokensvercel-labs/agent-skills
Turborepovercel/turborepo
Docker Expertsickn33/antigravity-awesome-skills
Journey fit
Primary fit
Shipping safely is where CI gates block merge; this skill exists to unblock that gate on a branch you already intend to land. Testing is the canonical shelf because failed checks are surfaced as automated test, lint, typecheck, and build pipeline failures on the PR.
Common Questions / FAQ
Is Fix Ci Failures safe to install?
skills.sh reports 2 of 3 security scanners passed. Review the Security Audits panel on this page before installing in production.
SKILL.md
READMESKILL.md - Fix Ci Failures
# 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: Download Failure Logs There are two approaches depending on the type of failure. ### Option A: View Failed Step Logs Directly Best for build/compile/lint failures where the error is in the step output: ```bash # View only the failed step logs (most useful — shows just the errors) gh run view <RUN_ID> --job <JOB_ID> --log-failed ``` > **Important**: `--log-failed` requires the **entire run** to complete, not just the failed job. If other jobs are still running, this command will block or error. Use **Option C** below to get logs for a completed job while the run is still in progress. The output can be large. Pipe through `tail` or `grep` to focus: ```bash # Last 100 lines of failed output gh run view <RUN_ID> --job <JOB_ID> --log-failed | tail -100 # Search for common error patterns gh run view <RUN_ID> --job <JOB_ID> --log-failed | grep -E "Error|FAIL|error TS|AssertionError|failing" ``` ### Option B: Download Artifacts Best for integration test failures where detailed logs (terminal logs, ext host logs, crash dumps) are uploaded as artifacts: ```bash # List available artifacts for a run gh run download <RUN_ID> --pattern '*' --dir /dev/null 2>&1 || gh run view <RUN_ID> --json jobs --jq '.jobs[].name' # Download log artifacts for a specific failed job # Artifact naming convention: logs-<platform>-<arch>-<test-type>-<attempt> # Examples: logs-linux-x64-electron-1, logs-linux-x64-remote-1 gh run download <RUN_ID> -n "logs-linux-x64-electron-1" -D /tmp/ci-logs # Download crash dumps if available gh run download <RUN_ID> -n "crash-dump-linux-x64-electron-1" -D /tmp/ci-crashes ``` > **Tip**: Use the test runner name from the failed check (e.g., "Linux / Electron" → `electron`, "Linux / Remote" → `remote`) and platform map ("Windows" → `windows-x64`, "Linux" → `linux-x64`, "macOS" → `macos-arm64`) to construct the artifact name. > **Warning**: Log artifacts may be empty if the test runner crashed before producing output (e.g., Electron download failure). In that case, fall back to **Option C**. ### Option C: Download Per-Job Logs via API (works while run is in progress) When the run is still in progress but the failed job has completed, use the GitHub API to d