GitHub Actions Retry Recovery Audit
Use this skill to find workflow/job slices that repeatedly fail before eventually succeeding, so teams can target flaky reruns with the biggest minute waste.
What this skill does
- - Reads one or more GitHub Actions workflow run JSON exports
- Groups attempts by repository/workflow/branch/commit (
headSha) - Detects recovery sequences where one or more failure-like attempts are followed by success
- Calculates wasted minutes consumed before first success in each sequence
- Emits text or JSON output for triage dashboards and CI fail gates
Inputs
Optional:
- -
RUN_GLOB (default: artifacts/github-actions/*.json) - INLINECODE3 (default:
20) - INLINECODE5 (
text or json, default: text) - INLINECODE9 (default:
20) - INLINECODE11 (default:
60) - INLINECODE13 (
0 or 1, default: 0) - INLINECODE17 ,
WORKFLOW_EXCLUDE (regex, optional) - INLINECODE19 ,
BRANCH_EXCLUDE (regex, optional) - INLINECODE21 ,
REPO_EXCLUDE (regex, optional)
Collect run JSON
CODEBLOCK0
Run
Text report:
CODEBLOCK1
JSON output + fail gate:
CODEBLOCK2
Output contract
- - Exit
0 in report mode - Exit
1 when FAIL_ON_CRITICAL=1 and critical recoveries are present - Text output includes summary plus top recovery groups ranked by wasted minutes
- JSON output includes
summary, ranked recoveries, and INLINECODE28
GitHub Actions 重试恢复审计
使用此技能查找反复失败但最终成功的工作流/作业片段,以便团队能够针对浪费最多分钟数的易失败重试进行优化。
此技能的功能
- - 读取一个或多个 GitHub Actions 工作流运行的 JSON 导出文件
- 按仓库/工作流/分支/提交(headSha)对尝试进行分组
- 检测恢复序列,即一次或多次失败尝试后跟成功的序列
- 计算每个序列中首次成功前浪费的分钟数
- 输出文本或 JSON 格式,用于分类仪表板和 CI 失败门控
输入参数
可选参数:
- - RUNGLOB(默认值:artifacts/github-actions/*.json)
- TOPN(默认值:20)
- OUTPUTFORMAT(text 或 json,默认值:text)
- WARNWASTEMINUTES(默认值:20)
- CRITICALWASTEMINUTES(默认值:60)
- FAILONCRITICAL(0 或 1,默认值:0)
- WORKFLOWMATCH、WORKFLOWEXCLUDE(正则表达式,可选)
- BRANCHMATCH、BRANCHEXCLUDE(正则表达式,可选)
- REPOMATCH、REPO_EXCLUDE(正则表达式,可选)
收集运行 JSON
bash
gh run view --json databaseId,workflowName,headBranch,headSha,conclusion,createdAt,updatedAt,url,repository \
> artifacts/github-actions/run-.json
运行
文本报告:
bash
RUN_GLOB=artifacts/github-actions/*.json \
WARNWASTEMINUTES=20 \
CRITICALWASTEMINUTES=60 \
bash skills/github-actions-retry-recovery-audit/scripts/retry-recovery-audit.sh
JSON 输出 + 失败门控:
bash
RUN_GLOB=artifacts/github-actions/*.json \
OUTPUT_FORMAT=json \
FAILONCRITICAL=1 \
bash skills/github-actions-retry-recovery-audit/scripts/retry-recovery-audit.sh
输出约定
- - 报告模式下退出码为 0
- 当 FAILONCRITICAL=1 且存在严重恢复时,退出码为 1
- 文本输出包含摘要以及按浪费分钟数排序的顶级恢复组
- JSON 输出包含 summary、排序后的 recoveries 和 critical_recoveries