GitHub Actions Deploy Risk Audit
Use this skill to rank deployment workflows that are currently risky to trust for production releases.
What this skill does
- - Reads GitHub Actions run JSON exports
- Filters to deployment/release workflows (configurable regex)
- Groups by repository + workflow + branch
- Scores risk using:
- failure rate
- unresolved trailing failure streak
- days since last successful run
- - Flags warning/critical groups based on configurable score thresholds
- Emits text or JSON output for CI dashboards and release gates
Inputs
Optional:
- -
RUN_GLOB (default: artifacts/github-actions/*.json) - INLINECODE2 (default:
20) - INLINECODE4 (
text or json, default: text) - INLINECODE8 (default:
2) - INLINECODE10 (default:
(?i)(deploy|release|ship|production)) - INLINECODE12 (regex, optional)
- INLINECODE13 (regex, optional)
- INLINECODE14 (regex, optional)
- INLINECODE15 (regex, optional)
- INLINECODE16 (default:
20) - INLINECODE18 (default:
40) - INLINECODE20 (default:
7) - INLINECODE22 (default:
35) - INLINECODE24 (default:
60) - INLINECODE26 (
0 or 1, default: 0)
Collect run JSON
CODEBLOCK0
Run
Text report:
CODEBLOCK1
JSON output with fail gate:
CODEBLOCK2
Run with 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 deploy risk groups
- JSON mode prints summary + scored groups + critical group details
GitHub Actions 部署风险审计
使用此技能对当前在生产发布中信任风险较高的部署工作流进行排名。
技能功能
- - 读取 GitHub Actions 运行的 JSON 导出文件
- 筛选部署/发布工作流(可配置正则表达式)
- 按仓库 + 工作流 + 分支进行分组
- 使用以下指标进行风险评分:
- 失败率
- 未解决的连续失败次数
- 自上次成功运行以来的天数
- - 根据可配置的评分阈值标记警告/严重分组
- 为 CI 仪表板和发布门禁输出文本或 JSON 格式
输入参数
可选参数:
- - RUNGLOB(默认值:artifacts/github-actions/*.json)
- TOPN(默认值:20)
- OUTPUTFORMAT(text 或 json,默认值:text)
- MINRUNS(默认值:2)
- DEPLOYWORKFLOWMATCH(默认值:(?i)(deploy|release|ship|production))
- BRANCHMATCH(正则表达式,可选)
- BRANCHEXCLUDE(正则表达式,可选)
- REPOMATCH(正则表达式,可选)
- REPOEXCLUDE(正则表达式,可选)
- FAILWARNPERCENT(默认值:20)
- FAILCRITICALPERCENT(默认值:40)
- STALESUCCESSDAYS(默认值:7)
- WARNSCORE(默认值:35)
- CRITICALSCORE(默认值:60)
- FAILONCRITICAL(0 或 1,默认值:0)
收集运行 JSON
bash
gh run view --json databaseId,workflowName,event,conclusion,headBranch,headSha,createdAt,updatedAt,startedAt,url,repository \
> artifacts/github-actions/run-.json
运行
文本报告:
bash
RUN_GLOB=artifacts/github-actions/*.json \
DEPLOYWORKFLOWMATCH=(?i)(deploy|release) \
MIN_RUNS=3 \
bash skills/github-actions-deploy-risk-audit/scripts/deploy-risk-audit.sh
带失败门禁的 JSON 输出:
bash
RUN_GLOB=artifacts/github-actions/*.json \
OUTPUT_FORMAT=json \
FAILONCRITICAL=1 \
bash skills/github-actions-deploy-risk-audit/scripts/deploy-risk-audit.sh
使用捆绑测试数据运行:
bash
RUN_GLOB=skills/github-actions-deploy-risk-audit/fixtures/*.json \
bash skills/github-actions-deploy-risk-audit/scripts/deploy-risk-audit.sh
输出约定
- - 报告模式下退出码为 0(默认)
- 当 FAILONCRITICAL=1 且存在一个或多个严重分组时,退出码为 1
- 文本模式打印摘要 + 排名的部署风险分组
- JSON 模式打印摘要 + 评分分组 + 严重分组详情