GitHub Actions Merge Queue Health Audit
Use this skill to catch unhealthy merge_group (or pull-request gate) workflows before queue times and failures block merges.
What this skill does
- - Reads GitHub Actions run JSON exports
- Focuses on merge queue style events (
merge_group by default) - Aggregates health by repo/workflow (or repo/workflow/branch)
- Scores risk using failure rate, queue latency, and stale-success age
- Emits
ok / warn / critical with optional CI fail gate
Inputs
Optional:
- -
RUN_GLOB (default: artifacts/github-actions/*.json) - INLINECODE7 (default:
20) - INLINECODE9 (
text or json, default: text) - INLINECODE13 (
repo-workflow or repo-workflow-branch, default: repo-workflow) - INLINECODE17 (optional ISO timestamp override for deterministic replay)
- INLINECODE18 (comma list, default:
merge_group) - INLINECODE20 (0..1, default:
0.2) - INLINECODE22 (0..1, default:
0.4) - INLINECODE24 (default:
8) - INLINECODE26 (default:
20) - INLINECODE28 (default:
18) - INLINECODE30 (default:
48) - INLINECODE32 (default:
3) - INLINECODE34 /
WORKFLOW_EXCLUDE (regex, optional) - INLINECODE36 /
BRANCH_EXCLUDE (regex, optional) - INLINECODE38 /
REPO_EXCLUDE (regex, optional) - INLINECODE40 /
EVENT_EXCLUDE (regex, optional) - INLINECODE42 (
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 risk groups
- JSON mode prints summary + ranked groups + critical groups
GitHub Actions 合并队列健康审计
使用此技能可在队列延迟和失败阻塞合并之前,捕获不健康的merge_group(或拉取请求门控)工作流。
技能功能
- - 读取GitHub Actions运行JSON导出文件
- 专注于合并队列类型事件(默认merge_group)
- 按仓库/工作流(或仓库/工作流/分支)聚合健康状态
- 使用失败率、队列延迟和过期成功时长进行风险评分
- 输出ok/warn/critical状态,可选CI失败门控
输入参数
可选参数:
- - RUNGLOB(默认值:artifacts/github-actions/*.json)
- TOPN(默认值:20)
- OUTPUTFORMAT(text或json,默认值:text)
- GROUPBY(repo-workflow或repo-workflow-branch,默认值:repo-workflow)
- NOWISO(可选ISO时间戳覆盖,用于确定性重放)
- EVENTS(逗号分隔列表,默认值:mergegroup)
- WARNFAILURERATE(0..1,默认值:0.2)
- CRITICALFAILURERATE(0..1,默认值:0.4)
- WARNP95QUEUEMINUTES(默认值:8)
- CRITICALP95QUEUEMINUTES(默认值:20)
- WARNSTALESUCCESSHOURS(默认值:18)
- CRITICALSTALESUCCESSHOURS(默认值:48)
- MINRUNS(默认值:3)
- WORKFLOWMATCH/WORKFLOWEXCLUDE(正则表达式,可选)
- BRANCHMATCH/BRANCHEXCLUDE(正则表达式,可选)
- REPOMATCH/REPOEXCLUDE(正则表达式,可选)
- EVENTMATCH/EVENTEXCLUDE(正则表达式,可选)
- FAILON_CRITICAL(0或1,默认值:0)
收集运行JSON
bash
gh run view \
--json databaseId,workflowName,event,headBranch,status,conclusion,createdAt,runStartedAt,updatedAt,url,repository \
> artifacts/github-actions/run-.json
运行
文本报告:
bash
RUN_GLOB=artifacts/github-actions/*.json \
bash skills/github-actions-merge-queue-health-audit/scripts/merge-queue-health-audit.sh
JSON输出+失败门控:
bash
RUN_GLOB=artifacts/github-actions/*.json \
OUTPUT_FORMAT=json \
FAILONCRITICAL=1 \
bash skills/github-actions-merge-queue-health-audit/scripts/merge-queue-health-audit.sh
使用捆绑测试数据运行:
bash
NOW_ISO=2026-03-08T00:00:00Z \
RUN_GLOB=skills/github-actions-merge-queue-health-audit/fixtures/*.json \
bash skills/github-actions-merge-queue-health-audit/scripts/merge-queue-health-audit.sh
输出约定
- - 报告模式下退出码为0(默认)
- 当FAILONCRITICAL=1且存在一个或多个关键组时,退出码为1
- 文本模式输出摘要+排序后的风险组
- JSON模式输出摘要+排序后的组+关键组