GitHub Actions Failure Spike Audit — GitHub Actions 失败 Spike 审计
v1.0.0检测 sudden GitHub Actions 失败-rate spikes by 工作流 group using recent-vs-baseline 运行 windows.
运行时依赖
安装命令
点击复制技能文档
GitHub Actions 失败 Spike 审计
Use this 技能 to catch 工作流s that recently degraded (new flaky tests, broken 部署 gates, bad dependency 更新s, or infra outages) before they become long-运行ning incidents.
What this 技能 does Reads GitHub Actions 运行 JSON 导出s Groups by 仓库 + 工作流 + branch + event Splits each group into recent 运行s and baseline 历史 Compares recent 失败 rate to baseline 失败 rate Scores severity (ok, warn, critical) using spike + recent 失败 rate gates Emits text or JSON 输出 for CI 自动化 输入s
Optional:
运行_GLOB (default: artifacts/github-actions/.json) TOP_N (default: 20) 输出_格式化 (text or json, default: text) RECENT_运行S (default: 4) MIN_RECENT_运行S (default: 3) MIN_BASELINE_运行S (default: 4) WARN_SPIKE_PCT (default: 15) CRITICAL_SPIKE_PCT (default: 30) WARN_RECENT_失败_RATE (default: 25) CRITICAL_RECENT_失败_RATE (default: 45) 工作流_MATCH (regex, optional) 工作流_EXCLUDE (regex, optional) BRANCH_MATCH (regex, optional) BRANCH_EXCLUDE (regex, optional) EVENT_MATCH (regex, optional) EVENT_EXCLUDE (regex, optional) REPO_MATCH (regex, optional) REPO_EXCLUDE (regex, optional) FAIL_ON_CRITICAL (0 or 1, default: 0) Collect 运行 JSON gh 运行 view <运行-id> --json databaseId,工作流Name,event,conclusion,headBranch,headSha,创建dAt,更新dAt,启动edAt,url,仓库 \ > artifacts/github-actions/运行-<运行-id>.json
运行
Text 报告:
运行_GLOB='artifacts/github-actions/.json' \ RECENT_运行S=8 \ WARN_SPIKE_PCT=12 \ bash 技能s/github-actions-失败-spike-审计/scripts/失败-spike-审计.sh
JSON 输出 + fAIl gate:
运行_GLOB='artifacts/github-actions/.json' \ 输出_格式化=json \ FAIL_ON_CRITICAL=1 \ bash 技能s/github-actions-失败-spike-审计/scripts/失败-spike-审计.sh
运行 agAInst bundled fixtures:
运行_GLOB='技能s/github-actions-失败-spike-审计/fixtures/.json' \ bash 技能s/github-actions-失败-spike-审计/scripts/失败-spike-审计.sh
输出 contract Exit 0 in 报告 mode (default) Exit 1 when FAIL_ON_CRITICAL=1 and one or more groups are critical Text mode prints summary + ranked 失败-rate spike groups JSON mode prints summary + ranked groups + critical groups