GitHub Actions Failure Streak Audit
Use this skill to find repeated CI failures before they become delivery bottlenecks.
What this skill does
- - Reads GitHub Actions run JSON exports (
gh run view --json ...) - Groups runs by repo + workflow + branch
- Detects consecutive failure streaks (
failure, cancelled, timed_out) - Scores severity by streak length and impacted runtime minutes
- Surfaces longest unresolved streaks first
Inputs
Optional:
- -
RUN_GLOB (default: artifacts/github-actions/*.json) - INLINECODE6 (default:
20) - INLINECODE8 (
text or json, default: text) - INLINECODE12 (default:
2) - INLINECODE14 (default:
4) - INLINECODE16 (
0 or 1, default: 0) - INLINECODE20 ,
WORKFLOW_EXCLUDE (regex, optional) - INLINECODE22 ,
REPO_EXCLUDE (regex, optional) - INLINECODE24 ,
BRANCH_EXCLUDE (regex, optional)
Collect run JSON
CODEBLOCK0
Run
Text report:
CODEBLOCK1
JSON output + fail gate:
CODEBLOCK2
Run with bundled fixtures:
CODEBLOCK3
Output contract
- - Exit
0 in reporting mode - Exit
1 when FAIL_ON_CRITICAL=1 and critical streaks exist - Text output includes grouped streak totals and ranked hotspots
- JSON output includes
summary, streaks, and INLINECODE31
GitHub Actions 连续失败审计
使用此技能在重复性CI失败成为交付瓶颈之前发现它们。
该技能的功能
- - 读取GitHub Actions运行JSON导出文件(gh run view --json ...)
- 按仓库+工作流+分支对运行进行分组
- 检测连续失败序列(failure、cancelled、timed_out)
- 根据连续失败长度和影响的运行分钟数评估严重程度
- 优先显示最长的未解决连续失败序列
输入参数
可选参数:
- - RUNGLOB(默认值:artifacts/github-actions/*.json)
- TOPN(默认值:20)
- OUTPUTFORMAT(text或json,默认值:text)
- WARNSTREAK(默认值:2)
- CRITICALSTREAK(默认值:4)
- FAILONCRITICAL(0或1,默认值:0)
- WORKFLOWMATCH、WORKFLOWEXCLUDE(正则表达式,可选)
- REPOMATCH、REPOEXCLUDE(正则表达式,可选)
- BRANCHMATCH、BRANCH_EXCLUDE(正则表达式,可选)
收集运行JSON
bash
gh run view --json databaseId,workflowName,headBranch,headSha,createdAt,updatedAt,conclusion,url,repository,jobs \
> artifacts/github-actions/run-.json
运行
文本报告:
bash
RUN_GLOB=artifacts/github-actions/*.json \
WARN_STREAK=2 \
CRITICAL_STREAK=4 \
bash skills/github-actions-failure-streak-audit/scripts/failure-streak-audit.sh
JSON输出+失败门控:
bash
RUN_GLOB=artifacts/github-actions/*.json \
OUTPUT_FORMAT=json \
FAILONCRITICAL=1 \
bash skills/github-actions-failure-streak-audit/scripts/failure-streak-audit.sh
使用捆绑的测试数据运行:
bash
RUN_GLOB=skills/github-actions-failure-streak-audit/fixtures/*.json \
bash skills/github-actions-failure-streak-audit/scripts/failure-streak-audit.sh
输出约定
- - 报告模式下退出码为0
- 当FAILONCRITICAL=1且存在严重连续失败时退出码为1
- 文本输出包含分组的连续失败总数和排名热点
- JSON输出包含summary、streaks和critical_streaks