Skip to content
Back to skills

Gh Run Failure

ASecurity

Use to analyze failures in GitHub pipelines or jobs.

  • 666 stars
  • 0 votes
  • 0 copies
  • 2 views
  • Added February 8, 2026
toolsgitapidatabase

Works with

  • api

Security analysis

A100/100

Scanned February 12, 2026

npx -y skills add majiayu000/claude-skill-registry --skill gh-run-failure --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Gh Run Failure?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Gh Run Failure
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/majiayu000-gh-run-failure/badge)](https://www.skillsdirectory.com/skills/majiayu000-gh-run-failure)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: gh-run-failure
description: Use to analyze failures in GitHub pipelines or jobs.
---

<general_guidelines>
- Assume the `gh` tool is installed and configured.
- Avoid printing full logs; focus on the failing step.
- For large logs, prefer downloading artifacts.
- If a test case failed, specify which test and how to run it locally.
</general_guidelines>

## List recent runs
<example>
gh run list --limit 20 --json databaseId,createdAt,headBranch,event,conclusion,status,displayTitle \
    --template '{{range .}}{{printf "%8v  %-20s  %-8s  %-10s  %-10s  %s\n" .databaseId .createdAt .status .conclusion .event .displayTitle}}{{end}}'
</example>

## Inspect a single run
<example>
RUN_ID=123456789
gh run view "$RUN_ID" --json status,conclusion,createdAt,headSha,headBranch,event,workflowName,url
</example>

## Show only failed jobs or steps
<example>
gh run view "$RUN_ID" --json jobs --jq '
    .jobs[]
    | select(.conclusion != "success")
    | .name as $job
    | (.steps[]? | select(.conclusion != "success") | "\($job) :: \(.name) :: \(.conclusion)")'
</example>

## View failed jobs/steps output
<example>
gh run view "$RUN_ID" --log-failed
</example>

To focus on a specific job, first list them:
<example>
gh run view "$RUN_ID" --json jobs --jq '.jobs[] | "\(.databaseId)\t\(.name)\t\(.conclusion)"'
</example>

Then fetch that job's log:
<example>
JOB_ID=987654321
gh run view "$RUN_ID" --job "$JOB_ID" --log
</example>

## List artifacts from a run
<example>
gh run download "$RUN_ID" --list
</example>

## Download a specific artifact
<example>
gh run download "$RUN_ID" --name "test-logs" --dir /tmp/github-run-"$RUN_ID"
</example>

After downloading, search locally for errors:
<example>
rg -n "error|fail|exception" /tmp/github-run-"$RUN_ID"
</example>

## Compare failed and latest successful run

Get latest successful run ID:
<example>
BRANCH=main
OK=$(gh run list --branch "$BRANCH" --limit 50 --json databaseId,conclusion \
    --jq '.[] | select(.conclusion=="success") | .databaseId' | head -n1)
echo "$OK"
</example>

Diff their SHAs:
<example>
FAIL_SHA=$(gh run view "$RUN_ID" --json headSha --jq .headSha)
OK_SHA=$(gh run view "$OK" --json headSha --jq .headSha)
gh api repos/:owner/:repo/compare/"$OK_SHA"..."$FAIL_SHA" --jq '.commits[].commit.message' | sed 's/^/- /'
</example>

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.