GitHub Actions Failure Owner Audit
Use this skill to attribute GitHub Actions failures to owners (actors) so teams can route CI stabilization work by impact instead of guesswork.
What this skill does
- - Reads one or more GitHub Actions run JSON exports (
gh api output or per-run JSON files) - Focuses on failure-like conclusions by default (
failure, cancelled, timed_out, action_required, startup_failure) - Groups by repository + actor (or repository + actor + workflow)
- Scores hotspots by failed run counts and total failed runtime minutes
- Supports text and JSON output for triage meetings and automation
Inputs
Optional:
- -
RUN_GLOB (default: artifacts/github-actions-runs/*.json) - INLINECODE8 (default:
20) - INLINECODE10 (
text or json, default: text) - INLINECODE14 (
actor, actor-workflow, owner, or owner-workflow, default: actor) - INLINECODE20 (optional JSON mapping file to map actor regex → owner/team)
- INLINECODE21 (default:
3) - INLINECODE23 (default:
6) - INLINECODE25 (default:
30) - INLINECODE27 (default:
90) - INLINECODE29 (
0 or 1, default: 0) - INLINECODE33 /
REPO_EXCLUDE (regex, optional) - INLINECODE35 /
WORKFLOW_EXCLUDE (regex, optional) - INLINECODE37 /
BRANCH_EXCLUDE (regex, optional) - INLINECODE39 /
ACTOR_EXCLUDE (regex, optional) - INLINECODE41 /
CONCLUSION_EXCLUDE (regex, optional)
Collect run JSON
Single repository paginated export:
CODEBLOCK0
Run
Default ownership triage:
CODEBLOCK1
Workflow-scoped ownership triage with stricter thresholds:
CODEBLOCK2
JSON output for dashboards/alerts:
CODEBLOCK3
Filter to a repo and release branches only:
CODEBLOCK4
Run with bundled fixtures:
CODEBLOCK5
Owner/team mapping (first matching regex wins):
CODEBLOCK6
CODEBLOCK7
Output contract
- - Exit
0 in reporting mode (default) - Exit
1 if FAIL_ON_CRITICAL=1 and at least one ownership group is critical - In
text mode: prints summary and top ownership hotspots - In
json mode: prints summary, top groups, all groups, and critical groups
GitHub Actions 失败责任人审计
使用此技能将GitHub Actions失败归因于责任人(执行者),使团队能够基于影响而非猜测来安排CI稳定性工作。
此技能的功能
- - 读取一个或多个GitHub Actions运行JSON导出文件(gh api输出或每个运行的JSON文件)
- 默认关注类似失败的结论(failure、cancelled、timedout、actionrequired、startup_failure)
- 按仓库+执行者(或仓库+执行者+工作流)分组
- 根据失败运行次数和总失败运行分钟数对热点进行评分
- 支持文本和JSON输出,用于分类会议和自动化
输入参数
可选参数:
- - RUNGLOB(默认值:artifacts/github-actions-runs/*.json)
- TOPN(默认值:20)
- OUTPUTFORMAT(text或json,默认值:text)
- GROUPBY(actor、actor-workflow、owner或owner-workflow,默认值:actor)
- OWNERMAPFILE(可选的JSON映射文件,用于将执行者正则表达式映射到责任人/团队)
- WARNFAILURERUNS(默认值:3)
- CRITICALFAILURERUNS(默认值:6)
- WARNFAILUREMINUTES(默认值:30)
- CRITICALFAILUREMINUTES(默认值:90)
- FAILONCRITICAL(0或1,默认值:0)
- REPOMATCH / REPOEXCLUDE(正则表达式,可选)
- WORKFLOWMATCH / WORKFLOWEXCLUDE(正则表达式,可选)
- BRANCHMATCH / BRANCHEXCLUDE(正则表达式,可选)
- ACTORMATCH / ACTOREXCLUDE(正则表达式,可选)
- CONCLUSIONMATCH / CONCLUSIONEXCLUDE(正则表达式,可选)
收集运行JSON
单个仓库分页导出:
bash
gh api repos///actions/runs --paginate \
> artifacts/github-actions-runs/-.json
运行
默认责任人分类:
bash
RUN_GLOB=artifacts/github-actions-runs/*.json \
bash skills/github-actions-failure-owner-audit/scripts/failure-owner-audit.sh
工作流范围的责任人分类,使用更严格的阈值:
bash
RUN_GLOB=artifacts/github-actions-runs/*.json \
GROUP_BY=actor-workflow \
WARNFAILURERUNS=2 \
CRITICALFAILURERUNS=4 \
WARNFAILUREMINUTES=20 \
CRITICALFAILUREMINUTES=60 \
bash skills/github-actions-failure-owner-audit/scripts/failure-owner-audit.sh
用于仪表板/告警的JSON输出:
bash
RUN_GLOB=artifacts/github-actions-runs/*.json \
OUTPUT_FORMAT=json \
FAILONCRITICAL=1 \
bash skills/github-actions-failure-owner-audit/scripts/failure-owner-audit.sh
过滤到单个仓库且仅限发布分支:
bash
RUN_GLOB=artifacts/github-actions-runs/*.json \
REPO_MATCH=^flowcreatebot/ \
BRANCH_MATCH=^(main|release/) \
ACTOR_EXCLUDE=(dependabot|renovate) \
bash skills/github-actions-failure-owner-audit/scripts/failure-owner-audit.sh
使用捆绑的测试数据运行:
bash
RUN_GLOB=skills/github-actions-failure-owner-audit/fixtures/*.json \
bash skills/github-actions-failure-owner-audit/scripts/failure-owner-audit.sh
责任人/团队映射(第一个匹配的正则表达式生效):
json
{
^dependabot\\[bot]$: automation,
^renovate\\[bot]$: automation,
^alice$: platform
}
bash
RUN_GLOB=artifacts/github-actions-runs/*.json \
GROUP_BY=owner-workflow \
OWNERMAPFILE=skills/github-actions-failure-owner-audit/examples/owner-map.sample.json \
bash skills/github-actions-failure-owner-audit/scripts/failure-owner-audit.sh
输出约定
- - 报告模式下退出码为0(默认)
- 如果FAILONCRITICAL=1且至少有一个责任人组处于严重状态,则退出码为1
- 在text模式下:打印摘要和主要责任人热点
- 在json模式下:打印摘要、主要组、所有组和严重组