GitHub Actions Queue Latency Audit
Use this skill to quantify where workflows are waiting in queue before jobs start.
What this skill does
- - Reads one or more GitHub Actions run JSON exports (from
gh run view --json ...) - Computes per-job queue wait (
startedAt - createdAt) and runtime duration (completedAt - startedAt) - Groups repeated jobs by repository + workflow + job name
- Ranks hotspots by worst queue wait and average queue wait
- Flags warning/critical queue waits with configurable thresholds
- Emits output as human-readable text or machine-readable JSON
Inputs
Optional:
- -
RUN_GLOB (default: artifacts/github-actions/*.json) - INLINECODE5 (default:
20) - INLINECODE7 (
text or json, default: text) - INLINECODE11 (default:
120) - INLINECODE13 (default:
300) - INLINECODE15 (
0 or 1, default: 0) — exit non-zero when any job instance hits/exceeds critical queue wait - INLINECODE19 (regex, optional)
- INLINECODE20 (regex, optional)
- INLINECODE21 (regex, optional)
- INLINECODE22 (regex, optional)
- INLINECODE23 (regex, optional)
- INLINECODE24 (regex, optional)
Collect run JSON
CODEBLOCK0
Run
Text report:
CODEBLOCK1
JSON output for dashboards:
CODEBLOCK2
Filter to one repo/workflow family:
CODEBLOCK3
Run with bundled fixtures:
CODEBLOCK4
Output contract
- - Exit
0 in reporting mode (default) - Exit
1 if FAIL_ON_CRITICAL=1 and at least one job instance has queue wait INLINECODE28 - In
text mode: prints summary + top queue hotspots - In
json mode: prints summary + grouped hotspot records + raw offending instances
GitHub Actions 队列延迟审计
使用此技能量化工作流在作业启动前的队列等待时间。
此技能的功能
- - 读取一个或多个 GitHub Actions 运行 JSON 导出文件(来自 gh run view --json ...)
- 计算每个作业的队列等待时间(startedAt - createdAt)和运行时长(completedAt - startedAt)
- 按仓库 + 工作流 + 作业名称对重复作业进行分组
- 按最差队列等待时间和平均队列等待时间对热点进行排名
- 使用可配置阈值标记警告/严重队列等待
- 输出为人类可读文本或机器可读 JSON
输入参数
可选参数:
- - RUNGLOB(默认值:artifacts/github-actions/*.json)
- TOPN(默认值:20)
- OUTPUTFORMAT(text 或 json,默认值:text)
- QUEUEWARNSECONDS(默认值:120)
- QUEUECRITICALSECONDS(默认值:300)
- FAILONCRITICAL(0 或 1,默认值:0)— 当任何作业实例达到/超过严重队列等待时以非零退出
- WORKFLOWMATCH(正则表达式,可选)
- WORKFLOWEXCLUDE(正则表达式,可选)
- JOBMATCH(正则表达式,可选)
- JOBEXCLUDE(正则表达式,可选)
- REPOMATCH(正则表达式,可选)
- REPO_EXCLUDE(正则表达式,可选)
收集运行 JSON
bash
gh run view --json databaseId,workflowName,headBranch,headSha,url,repository,jobs \
> artifacts/github-actions/run-.json
运行
文本报告:
bash
RUN_GLOB=artifacts/github-actions/*.json \
TOP_N=15 \
QUEUEWARNSECONDS=180 \
QUEUECRITICALSECONDS=420 \
bash skills/github-actions-queue-latency-audit/scripts/queue-latency-audit.sh
用于仪表板的 JSON 输出:
bash
RUN_GLOB=artifacts/github-actions/*.json \
OUTPUT_FORMAT=json \
FAILONCRITICAL=1 \
bash skills/github-actions-queue-latency-audit/scripts/queue-latency-audit.sh
过滤到单个仓库/工作流系列:
bash
RUN_GLOB=artifacts/github-actions/*.json \
REPO_MATCH=^flowcreatebot/ \
WORKFLOW_MATCH=(CI|Build|Test) \
bash skills/github-actions-queue-latency-audit/scripts/queue-latency-audit.sh
使用捆绑的测试数据运行:
bash
RUN_GLOB=skills/github-actions-queue-latency-audit/fixtures/*.json \
bash skills/github-actions-queue-latency-audit/scripts/queue-latency-audit.sh
输出约定
- - 报告模式下退出 0(默认)
- 如果 FAILONCRITICAL=1 且至少有一个作业实例的队列等待时间 >= QUEUECRITICALSECONDS,则退出 1
- 在 text 模式下:打印摘要 + 顶部队列热点
- 在 json 模式下:打印摘要 + 分组热点记录 + 原始违规实例