GitHub Actions Runtime Regression Audit
Use this skill to detect runtime regressions between historical baseline runs and current runs.
What this skill does
- - Reads baseline and current GitHub Actions run JSON exports (
gh run view --json ...) - Calculates average and p95 runtime per repository + workflow + job
- Compares current metrics against baseline and ranks largest regressions
- Flags warn/critical regressions by absolute seconds and percent delta
- Emits text summary for humans or JSON for automation
Inputs
Required:
- -
BASELINE_GLOB (glob for baseline run JSON files) - INLINECODE2 (glob for current run JSON files)
Optional:
- -
TOP_N (default: 20) - INLINECODE5 (
text or json, default: text) - INLINECODE9 (default:
30) - INLINECODE11 (default:
90) - INLINECODE13 (default:
15) - INLINECODE15 (default:
35) - INLINECODE17 (
0 or 1, default: 0) - INLINECODE21 (regex, optional)
- INLINECODE22 (regex, optional)
- INLINECODE23 (regex, optional)
- INLINECODE24 (regex, optional)
- INLINECODE25 (regex, optional)
- INLINECODE26 (regex, optional)
Collect run JSON
CODEBLOCK0
Capture a stable baseline window (for example previous 2 weeks), then current runs from latest commits.
Run
Text report:
CODEBLOCK1
JSON output with CI gate:
CODEBLOCK2
Run with bundled fixtures:
CODEBLOCK3
Output contract
- - Exit
0 in reporting mode (default) - Exit
1 when FAIL_ON_CRITICAL=1 and at least one job crosses critical regression thresholds - INLINECODE30 mode prints summary + top regressions + new jobs without baseline
- INLINECODE31 mode outputs summary, ranked regressions, and newly observed jobs
GitHub Actions 运行时回归审计
使用此技能检测历史基线运行与当前运行之间的运行时回归。
此技能的功能
- - 读取基线和当前的 GitHub Actions 运行 JSON 导出文件(gh run view --json ...)
- 计算每个仓库 + 工作流 + 作业的平均运行时间和 p95 运行时间
- 将当前指标与基线进行比较,并对最大的回归进行排序
- 根据绝对秒数和百分比变化标记警告/严重回归
- 输出供人工阅读的文本摘要或供自动化使用的 JSON 格式
输入参数
必需参数:
- - BASELINEGLOB(基线运行 JSON 文件的通配符)
- CURRENTGLOB(当前运行 JSON 文件的通配符)
可选参数:
- - TOPN(默认值:20)
- OUTPUTFORMAT(text 或 json,默认值:text)
- WARNDELTASECONDS(默认值:30)
- CRITICALDELTASECONDS(默认值:90)
- WARNDELTAPERCENT(默认值:15)
- CRITICALDELTAPERCENT(默认值:35)
- FAILONCRITICAL(0 或 1,默认值:0)
- WORKFLOWMATCH(正则表达式,可选)
- WORKFLOWEXCLUDE(正则表达式,可选)
- JOBMATCH(正则表达式,可选)
- JOBEXCLUDE(正则表达式,可选)
- REPOMATCH(正则表达式,可选)
- REPOEXCLUDE(正则表达式,可选)
收集运行 JSON
bash
gh run view <运行ID> --json databaseId,workflowName,headBranch,headSha,url,repository,jobs \
> artifacts/github-actions/run-<运行ID>.json
捕获稳定的基线窗口(例如前两周),然后从最新提交中获取当前运行。
运行
文本报告:
bash
BASELINE_GLOB=artifacts/github-actions/baseline/*.json \
CURRENT_GLOB=artifacts/github-actions/current/*.json \
TOP_N=15 \
WARNDELTASECONDS=45 \
CRITICALDELTASECONDS=120 \
bash skills/github-actions-runtime-regression-audit/scripts/runtime-regression-audit.sh
带 CI 门控的 JSON 输出:
bash
BASELINE_GLOB=artifacts/github-actions/baseline/*.json \
CURRENT_GLOB=artifacts/github-actions/current/*.json \
OUTPUT_FORMAT=json \
FAILONCRITICAL=1 \
bash skills/github-actions-runtime-regression-audit/scripts/runtime-regression-audit.sh
使用捆绑的测试数据运行:
bash
BASELINE_GLOB=skills/github-actions-runtime-regression-audit/fixtures/baseline-*.json \
CURRENT_GLOB=skills/github-actions-runtime-regression-audit/fixtures/current-*.json \
bash skills/github-actions-runtime-regression-audit/scripts/runtime-regression-audit.sh
输出约定
- - 在报告模式下退出码为 0(默认)
- 当 FAILONCRITICAL=1 且至少有一个作业超过严重回归阈值时,退出码为 1
- text 模式输出摘要 + 最大回归 + 无基线的全新作业
- json 模式输出摘要、排序后的回归以及新观察到的作业