GitHub Actions Rerun Effectiveness Audit
Use this skill to measure how often workflows require reruns and whether reruns are actually recovering failures.
What this skill does
- - Reads GitHub Actions run JSON exports
- Tracks rerun episodes using workflow run id + attempt history
- Measures rerun rate, rerun success rate, and extra rerun attempts
- Estimates wasted rerun minutes from attempt durations
- Emits severity (
ok, warn, critical) for CI policy gates
Inputs
Optional:
- -
RUN_GLOB (default: artifacts/github-actions/*.json) - INLINECODE5 (default:
20) - INLINECODE7 (
text or json, default: text) - INLINECODE11 (
workflow or workflow-branch, default: workflow) - INLINECODE15 (comma-separated, default:
failure,cancelled,timed_out,startup_failure,action_required) - INLINECODE17 (comma-separated, default:
success) - INLINECODE19 (minimum workflow runs required, default:
4) - INLINECODE21 (0..1, default:
0.2) - INLINECODE23 (0..1, default:
0.35) - INLINECODE25 (0..1, default:
0.5) - INLINECODE27 (0..1, default:
0.25) - INLINECODE29 (default:
20) - INLINECODE31 (default:
60) - INLINECODE33 /
WORKFLOW_EXCLUDE (regex, optional) - INLINECODE35 /
BRANCH_EXCLUDE (regex, optional) - INLINECODE37 /
EVENT_EXCLUDE (regex, optional) - INLINECODE39 /
REPO_EXCLUDE (regex, optional) - INLINECODE41 /
ACTOR_EXCLUDE (regex, optional) - INLINECODE43 (
0 or 1, default: 0)
Collect run JSON
CODEBLOCK0
Run
Text report:
CODEBLOCK1
JSON output + fail gate:
CODEBLOCK2
Run against bundled fixtures:
CODEBLOCK3
Output contract
- - Exit
0 in report mode (default) - Exit
1 when FAIL_ON_CRITICAL=1 and one or more groups are critical - Text mode prints summary + ranked workflow groups
- JSON mode prints summary + ranked groups + critical groups
技能名称: github-actions-rerun-effectiveness-audit
详细描述:
GitHub Actions 重跑有效性审计
使用此技能来衡量工作流需要重跑的频率,以及重跑是否真的能恢复失败。
该技能的功能
- - 读取 GitHub Actions 运行 JSON 导出文件
- 使用工作流运行 ID + 尝试历史记录追踪重跑事件
- 衡量重跑率、重跑成功率以及额外重跑尝试次数
- 根据尝试持续时间估算浪费的重跑分钟数
- 为 CI 策略门控输出严重级别(ok、warn、critical)
输入参数
可选参数:
- - RUNGLOB(默认值:artifacts/github-actions/*.json)
- TOPN(默认值:20)
- OUTPUTFORMAT(text 或 json,默认值:text)
- GROUPBY(workflow 或 workflow-branch,默认值:workflow)
- FAILURECONCLUSIONS(逗号分隔,默认值:failure,cancelled,timedout,startupfailure,actionrequired)
- SUCCESSCONCLUSIONS(逗号分隔,默认值:success)
- MINRUNS(最小工作流运行次数,默认值:4)
- WARNRERUNRATE(0..1,默认值:0.2)
- CRITICALRERUNRATE(0..1,默认值:0.35)
- WARNRERUNSUCCESSRATE(0..1,默认值:0.5)
- CRITICALRERUNSUCCESSRATE(0..1,默认值:0.25)
- WARNWASTEDMINUTES(默认值:20)
- CRITICALWASTEDMINUTES(默认值:60)
- WORKFLOWMATCH / WORKFLOWEXCLUDE(正则表达式,可选)
- BRANCHMATCH / BRANCHEXCLUDE(正则表达式,可选)
- EVENTMATCH / EVENTEXCLUDE(正则表达式,可选)
- REPOMATCH / REPOEXCLUDE(正则表达式,可选)
- ACTORMATCH / ACTOREXCLUDE(正则表达式,可选)
- FAILONCRITICAL(0 或 1,默认值:0)
收集运行 JSON
bash
gh run view --attempt \
--json databaseId,runAttempt,workflowName,event,headBranch,headSha,conclusion,createdAt,updatedAt,runStartedAt,url,repository,actor,triggeringActor \
> artifacts/github-actions/run--attempt-.json
运行
文本报告:
bash
RUN_GLOB=artifacts/github-actions/*.json \
bash skills/github-actions-rerun-effectiveness-audit/scripts/rerun-effectiveness-audit.sh
JSON 输出 + 失败门控:
bash
RUN_GLOB=artifacts/github-actions/*.json \
OUTPUT_FORMAT=json \
FAILONCRITICAL=1 \
bash skills/github-actions-rerun-effectiveness-audit/scripts/rerun-effectiveness-audit.sh
针对捆绑的测试数据运行:
bash
RUN_GLOB=skills/github-actions-rerun-effectiveness-audit/fixtures/*.json \
bash skills/github-actions-rerun-effectiveness-audit/scripts/rerun-effectiveness-audit.sh
输出约定
- - 在报告模式下退出码为 0(默认)
- 当 FAILONCRITICAL=1 且一个或多个组处于严重状态时,退出码为 1
- 文本模式打印摘要 + 排名靠前的工作流组
- JSON 模式打印摘要 + 排名靠前的组 + 严重组