Gha checks

From phatblat/dotfiles · View interactive version

Gha checks is an AI agent skill from the GitHub repository phatblat/dotfiles. Use when the user asks "did CI pass", "are checks green", "what failed", or wants a quick GitHub Actions status summary for a PR or the current branch.

How to use this skill

Skill file

GHA Checks

Quickly check GitHub Actions CI status for a PR or branch, summarize results, and triage failures.

When to Use

Process

Step 1: Resolve the Target

Determine what to check:

```bash

gh pr view --json number,url,headRefName --jq '"\(.number)|\(.url)|\(.headRefName)"'

```

```bash

branch=$(git branch --show-current)

gh run list --branch "$branch" --limit 5 --json databaseId,status,conclusion,name,createdAt,headBranch \

--jq '.[] | "\(.databaseId)|\(.name)|\(.status)|\(.conclusion // "—")|\(.createdAt)"'

```

Step 2: Get Check Status

For a PR:

gh pr checks <number> --json name,state,description,detailsUrl,completedAt \
  --jq '.[] | "\(.name)|\(.state)|\(.description // "")|\(.detailsUrl)"'

Step 3: Summarize

Present a concise summary:

## PR #<number> Checks

✅ 3 passed | ❌ 1 failed | ⏳ 1 pending

| Check | Status | Details |
|-------|--------|---------|
| build | ✅ pass | — |
| lint  | ✅ pass | — |
| test  | ❌ fail | Node 20 — exit code 1 |
| deploy | ⏳ pending | Waiting on test |

Rules:

Step 4: Triage Failures

For each failed check:

  1. Get the run ID:

```bash

gh pr checks <number> --json name,state,detailsUrl \

--jq '.[] | select(.state == "FAILURE") | "\(.name)|\(.detailsUrl)"'

```

  1. Extract the run ID from the URL (format: .../actions/runs/<id>/...)
  1. Get the failed step and tail of its log:

```bash

gh run view <run-id> --json jobs \

--jq '.jobs[] | select(.conclusion == "failure") | "\(.name): step \(.steps[] | select(.conclusion == "failure") | .name)"'

```

  1. Pull the last 50 lines of the failed job's log:

```bash

gh run view <run-id> --log-failed 2>/dev/null | tail -50

```

  1. Present a brief diagnosis:

```

### ❌ test (run 12345678)

Failed step: Run tests

<last few relevant log lines>

Likely cause: <one-sentence assessment>

```

Step 5: Offer Next Actions

Based on the results:

Re-running Jobs

When the user asks to re-run:

# Re-run only failed jobs (cheaper, faster)
gh run rerun <run-id> --failed

# Re-run all jobs in the run
gh run rerun <run-id>

Always prefer --failed unless the user explicitly asks to re-run everything.

Integration

Do NOT

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.