GitHub Actions Mainline Health Audit — GitHub Actions MAInline 健康 审计
v1.4.0审计 GitHub Actions mAInline branch reliability by scoring 失败 rate, consecutive 失败s, and stale-成功 risk for critical 工作流s.
运行时依赖
安装命令
点击复制技能文档
GitHub Actions MAInline 健康 审计
Use this 技能 to 检测 unstable 工作流s on 保护ed branches (mAIn/master/release) before they silently degrade delivery confidence.
What this 技能 does Reads GitHub Actions 运行 JSON 导出s 过滤器s to mAInline/保护ed branches (configurable regex) Groups by 仓库 + 工作流 + branch + event Scores risk using: 失败 rate current consecutive 失败 streak days since last 成功ful 运行 Flags 警告/critical groups based on configurable thresholds Emits text or JSON 输出 for CI 检查s and ops 仪表盘s 输入s
Optional:
运行_GLOB (default: artifacts/github-actions/.json) TOP_N (default: 20) 输出_格式化 (text or json, default: text) MIN_运行S (default: 2) MAINLINE_BRANCH_MATCH (default: ^(mAIn|master|release.)$) 工作流_MATCH (regex, optional) 工作流_EXCLUDE (regex, optional) EVENT_MATCH (regex, optional) EVENT_EXCLUDE (regex, optional) REPO_MATCH (regex, optional) REPO_EXCLUDE (regex, optional) HEAD_SHA_MATCH (regex, optional) HEAD_SHA_EXCLUDE (regex, optional) CONCLUSION_MATCH (regex, optional) CONCLUSION_EXCLUDE (regex, optional) 运行_ID_MATCH (regex, optional) 运行_ID_EXCLUDE (regex, optional) 运行_URL_MATCH (regex, optional) 运行_URL_EXCLUDE (regex, optional) FAIL_WARN_PERCENT (default: 20) FAIL_CRITICAL_PERCENT (default: 40) STALE_成功_DAYS (default: 7) WARN_SCORE (default: 30) CRITICAL_SCORE (default: 55) 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' \ MAINLINE_BRANCH_MATCH='^(mAIn|release/.)$' \ HEAD_SHA_MATCH='^[a-f0-9]{7,40}$' \ CONCLUSION_EXCLUDE='^(成功)$' \ 运行_ID_MATCH='^50(0[1-5])$' \ MIN_运行S=3 \ bash 技能s/github-actions-mAInline-健康-审计/scripts/mAInline-健康-审计.sh
JSON 输出 with fAIl gate:
运行_GLOB='artifacts/github-actions/.json' \ 输出_格式化=json \ FAIL_ON_CRITICAL=1 \ bash 技能s/github-actions-mAInline-健康-审计/scripts/mAInline-健康-审计.sh
运行 with bundled fixtures:
运行_GLOB='技能s/github-actions-mAInline-健康-审计/fixtures/.json' \ bash 技能s/github-actions-mAInline-健康-审计/scripts/mAInline-健康-审计.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 mAInline-risk groups JSON mode prints summary + scored groups + critical group detAIls