GitHub Actions Incident Timeline Audit
Use this skill to convert noisy failed run exports into incident windows you can triage quickly during CI reliability reviews.
What this skill does
- - Reads GitHub Actions run JSON exports
- Keeps only failed/cancelled/timed-out style outcomes
- Groups failures by repository into incident windows using a configurable gap threshold
- Scores each incident using failed-run and duration thresholds
- Emits text or JSON output for review docs, ops dashboards, and CI fail gates
Inputs
Optional:
- -
RUN_GLOB (default: artifacts/github-actions/*.json) - INLINECODE2 (default:
20) - INLINECODE4 (
text or json, default: text) - INLINECODE8 (default:
45) - INLINECODE10 (default:
2) - INLINECODE12 (default:
4) - INLINECODE14 (default:
20) - INLINECODE16 (default:
60) - INLINECODE18 (regex, optional)
- INLINECODE19 (regex, optional)
- INLINECODE20 (regex, optional)
- INLINECODE21 (regex, optional)
- INLINECODE22 (
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 incidents are critical - Text mode prints summary + ranked incident windows
- JSON mode prints summary + incidents + critical incident details
GitHub Actions 事件时间线审计
使用此技能将杂乱的失败运行导出转换为事件窗口,以便在CI可靠性审查期间快速分类。
此技能的功能
- - 读取GitHub Actions运行JSON导出文件
- 仅保留失败/取消/超时类型的结果
- 使用可配置的间隔阈值,将按仓库分组的失败归入事件窗口
- 使用失败运行和持续时间阈值对每个事件进行评分
- 输出文本或JSON格式,用于审查文档、运维仪表板和CI失败门控
输入参数
可选:
- - RUNGLOB(默认值:artifacts/github-actions/*.json)
- TOPN(默认值:20)
- OUTPUTFORMAT(text或json,默认值:text)
- INCIDENTGAPMINUTES(默认值:45)
- WARNFAILEDRUNS(默认值:2)
- CRITICALFAILEDRUNS(默认值:4)
- WARNDURATIONMINUTES(默认值:20)
- CRITICALDURATIONMINUTES(默认值:60)
- WORKFLOWMATCH(正则表达式,可选)
- WORKFLOWEXCLUDE(正则表达式,可选)
- REPOMATCH(正则表达式,可选)
- REPOEXCLUDE(正则表达式,可选)
- FAILON_CRITICAL(0或1,默认值:0)
收集运行JSON
bash
gh run view --json databaseId,workflowName,event,conclusion,headBranch,createdAt,updatedAt,startedAt,url,repository \
> artifacts/github-actions/run-.json
运行
文本报告:
bash
RUN_GLOB=artifacts/github-actions/*.json \
INCIDENTGAPMINUTES=45 \
bash skills/github-actions-incident-timeline-audit/scripts/incident-timeline-audit.sh
带失败门控的JSON输出:
bash
RUN_GLOB=artifacts/github-actions/*.json \
OUTPUT_FORMAT=json \
FAILONCRITICAL=1 \
bash skills/github-actions-incident-timeline-audit/scripts/incident-timeline-audit.sh
使用捆绑的测试数据运行:
bash
RUN_GLOB=skills/github-actions-incident-timeline-audit/fixtures/*.json \
bash skills/github-actions-incident-timeline-audit/scripts/incident-timeline-audit.sh
输出约定
- - 报告模式下退出码为0(默认)
- 当FAILONCRITICAL=1且存在一个或多个严重事件时,退出码为1
- 文本模式打印摘要 + 排名事件窗口
- JSON模式打印摘要 + 事件 + 严重事件详情