GitHub Actions Trigger Health Audit
Use this skill to find which GitHub Actions trigger events are driving the highest failure rates.
What this skill does
- - Reads one or more GitHub Actions run JSON exports
- Groups runs by repository + event + workflow
- Calculates failure/cancel/timeout rates and average runtime
- Flags warning/critical hotspots based on configurable failure-rate thresholds
- Supports regex include/exclude filters for repo, workflow, and event
- Emits text or JSON output for dashboards and automation gates
Inputs
Optional:
- -
RUN_GLOB (default: artifacts/github-actions/*.json) - INLINECODE2 (default:
20) - INLINECODE4 (
text or json, default: text) - INLINECODE8 (default:
2) — skip low-sample groups - INLINECODE10 (default:
20) - INLINECODE12 (default:
40) - INLINECODE14 (
0 or 1, default: 0) - INLINECODE18 (regex, optional)
- INLINECODE19 (regex, optional)
- INLINECODE20 (regex, optional)
- INLINECODE21 (regex, optional)
- INLINECODE22 (regex, optional)
- INLINECODE23 (regex, optional)
Collect run JSON
CODEBLOCK0
Run
Text report:
CODEBLOCK1
JSON output with fail gate:
CODEBLOCK2
Run with bundled fixtures:
CODEBLOCK3
Output contract
- - Exit
0 in report mode (default) - Exit
1 when FAIL_ON_CRITICAL=1 and any group meets critical threshold - Text mode prints summary + ranked trigger health hotspots
- JSON mode prints summary + grouped metrics + critical group details
GitHub Actions 触发事件健康审计
使用此技能可找出哪些 GitHub Actions 触发事件导致了最高的失败率。
技能功能
- - 读取一个或多个 GitHub Actions 运行 JSON 导出文件
- 按仓库 + 事件 + 工作流对运行进行分组
- 计算失败/取消/超时率及平均运行时间
- 基于可配置的失败率阈值标记警告/严重热点
- 支持对仓库、工作流和事件使用正则包含/排除过滤器
- 输出文本或 JSON 格式,用于仪表盘和自动化门控
输入参数
可选参数:
- - RUNGLOB(默认值:artifacts/github-actions/*.json)
- TOPN(默认值:20)
- OUTPUTFORMAT(text 或 json,默认值:text)
- MINRUNS(默认值:2)— 跳过样本量过小的分组
- FAILWARNPERCENT(默认值:20)
- FAILCRITICALPERCENT(默认值:40)
- FAILONCRITICAL(0 或 1,默认值:0)
- WORKFLOWMATCH(正则表达式,可选)
- WORKFLOWEXCLUDE(正则表达式,可选)
- EVENTMATCH(正则表达式,可选)
- EVENTEXCLUDE(正则表达式,可选)
- REPOMATCH(正则表达式,可选)
- REPOEXCLUDE(正则表达式,可选)
收集运行 JSON
bash
gh run view --json databaseId,workflowName,event,conclusion,headBranch,headSha,createdAt,updatedAt,startedAt,url,repository \
> artifacts/github-actions/run-.json
运行
文本报告:
bash
RUN_GLOB=artifacts/github-actions/*.json \
MIN_RUNS=3 \
FAILWARNPERCENT=25 \
FAILCRITICALPERCENT=50 \
bash skills/github-actions-trigger-health-audit/scripts/trigger-health-audit.sh
带失败门控的 JSON 输出:
bash
RUN_GLOB=artifacts/github-actions/*.json \
OUTPUT_FORMAT=json \
FAILONCRITICAL=1 \
bash skills/github-actions-trigger-health-audit/scripts/trigger-health-audit.sh
使用捆绑测试数据运行:
bash
RUN_GLOB=skills/github-actions-trigger-health-audit/fixtures/*.json \
bash skills/github-actions-trigger-health-audit/scripts/trigger-health-audit.sh
输出约定
- - 报告模式下退出码为 0(默认)
- 当 FAILONCRITICAL=1 且任意分组达到严重阈值时,退出码为 1
- 文本模式打印摘要 + 排名后的触发事件健康热点
- JSON 模式打印摘要 + 分组指标 + 严重分组详情