gha

gha is a command for Claude Code from sumulige/sumulige-claude. It costs 6 tokens per session (735 once invoked), scanned A, original, MIT.

A command that examines failed GitHub Actions runs, the automated checks GitHub uses to build and test code. It identifies likely causes such as flaky tests, timeouts, dependency failures, build errors, network problems, or missing permissions.

In plain words
What is it for?
Use it to investigate a specific or recent failed workflow, find flaky tests, review failure trends, and get suggested fixes with links to similar runs.
Why use it?
It reduces the time spent reading long CI logs and comparing past failures. It also helps distinguish a real code problem from an unreliable test or temporary service issue.

Command for Claude Code

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add commands/sumulige/sumulige-claude/gha
Clone the repo
git clone --depth 1 https://github.com/sumulige/sumulige-claude

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for gha

README.md
[![agentmods](https://agentmods.dev/badge/commands/sumulige/sumulige-claude/gha.svg)](https://agentmods.dev/commands/sumulige/sumulige-claude/gha)
Your own site
<a href="https://agentmods.dev/commands/sumulige/sumulige-claude/gha"><img src="https://agentmods.dev/badge/commands/sumulige/sumulige-claude/gha.svg" alt="Measured on agentmods" height="20"></a>
Per session 6 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 735 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00006 $0.00735
Opus 5 $0.00003 $0.00367
Sonnet 5 $0.00001 $0.00147
Haiku 4.5 $0.00001 $0.00073

Measured 5d ago against content hash 5a28d0d88ce8, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

gha scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 5d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.claude/commands/gha.md · 137 lines

What it actually says

/gha

分析 GitHub Actions CI 失败,自动检测问题并建议修复方案。

使用方式

/gha <workflow-url>   # 分析指定的 workflow run
/gha --last           # 分析最近失败的 workflow
/gha --flaky          # 检测 flaky tests
/gha --history        # 查看失败历史趋势

工作流程

Step 1: 获取 Workflow 信息

# 获取最近的 workflow runs
gh run list --limit 10

# 获取失败的 run 详情
gh run view <run-id> --log-failed

Step 2: 分析失败原因

检测以下常见问题:

问题类型 检测方式 建议
Flaky Test 同一测试随机失败 添加重试或修复竞态
Timeout 超时错误 优化性能或增加限制
Dependency 安装失败 检查版本锁定
Build Error 编译错误 检查代码变更
Network 网络超时 添加重试机制
Permission 权限错误 检查 GITHUB_TOKEN

Step 3: 生成报告

# GHA Analysis Report

## Workflow: [workflow-name]
**Run ID**: [run-id]
**Status**: ❌ Failed
**Duration**: [time]
**Triggered by**: [event]

## Failure Summary

### Job: [job-name]
**Step**: [step-name]
**Error Type**: [类型]

### Error Log

[关键错误日志]


## Root Cause Analysis

1. **主要原因**: [分析]
2. **相关 Commit**: [commit-sha]
3. **影响范围**: [范围]

## Recommendations

1. [ ] [建议修复 1]
2. [ ] [建议修复 2]

## Quick Fix

```bash
# 快速修复命令
[修复命令]

Similar Failures

  • [link to similar run 1]
  • [link to similar run 2]

### Step 4: 可选操作

```bash
# 重新运行失败的 workflow
gh run rerun <run-id> --failed

# 查看特定 job 日志
gh run view <run-id> --job <job-id> --log

常见问题快速诊断

Flaky Test 检测

# 检查最近 10 次运行中同一测试的失败率
gh run list --workflow=test.yml --limit 10 --json conclusion,databaseId

依赖问题

# 检查 lockfile 变更
git diff HEAD~1 -- package-lock.json yarn.lock pnpm-lock.yaml

权限问题

检查 workflow 文件中的 permissions:

permissions:
  contents: read
  pull-requests: write

集成 /fix

如果是代码问题,自动调用 /fix 修复:

/gha --last    # 分析失败
/fix --build   # 修复构建错误
/test          # 本地验证
/commit        # 提交修复
Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 5d ago First seen · 137 lines · 6 tokens per session scan A 5a28d0d88ce8

Subscribe to this mod's changes

gha is a command published in the GitHub repository sumulige/sumulige-claude (2 stars, last pushed 6mo ago), licensed MIT. It adds 6 tokens to every session and 735 once invoked, about $0.0000 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.