返回顶部
g

github-actions-timeout-risk-audit超时风险审计

Audit GitHub Actions job runtime risk against timeout thresholds so near-timeout jobs get fixed before they fail CI.

作者: admin | 来源: ClawHub
源自
ClawHub
版本
V 1.0.0
安全检测
已通过
236
下载量
免费
免费
0
收藏
概述
安装方式
版本历史

github-actions-timeout-risk-audit

GitHub Actions 超时风险审计

使用此技能查找正在超时或危险地接近超时限制的GitHub Actions作业。

此技能的功能

  • - 读取一个或多个运行JSON导出文件(gh run view --json ...)
  • 计算每个作业的运行时间(completedAt - startedAt)
  • 根据配置的超时阈值标记风险等级:
- 当运行时间超过WARNRATIO * JOBTIMEOUT_SECONDS时标记为warn - 当运行时间超过CRITICALRATIO * JOBTIMEOUT_SECONDS时标记为critical - 对于conclusion=timed_out的作业始终标记为critical
  • - 按仓库 + 工作流 + 作业名称对重复作业进行分组
  • 为CI门控/仪表板输出文本或JSON格式

输入参数

可选参数:
  • - RUNGLOB(默认值:artifacts/github-actions/*.json)
  • TOPN(默认值:20)
  • OUTPUTFORMAT(text或json,默认值:text)
  • JOBTIMEOUTSECONDS(默认值:3600)
  • WARNRATIO(默认值:0.80)
  • CRITICALRATIO(默认值:0.95)
  • FAILONCRITICAL(0或1,默认值:0)
  • WORKFLOWMATCH、WORKFLOWEXCLUDE(正则表达式,可选)
  • JOBMATCH、JOBEXCLUDE(正则表达式,可选)
  • REPOMATCH、REPOEXCLUDE(正则表达式,可选)
  • BRANCHMATCH、BRANCH_EXCLUDE(正则表达式,可选)

收集运行JSON

bash
gh run view --json databaseId,workflowName,headBranch,url,repository,jobs \
> artifacts/github-actions/run-.json

确保jobs包含startedAt、completedAt和conclusion。

运行

文本报告:

bash
RUN_GLOB=artifacts/github-actions/*.json \
JOBTIMEOUTSECONDS=3600 \
WARN_RATIO=0.85 \
CRITICAL_RATIO=0.95 \
bash skills/github-actions-timeout-risk-audit/scripts/timeout-risk-audit.sh

JSON输出 + 失败门控:

bash
RUN_GLOB=artifacts/github-actions/*.json \
OUTPUT_FORMAT=json \
FAILONCRITICAL=1 \
bash skills/github-actions-timeout-risk-audit/scripts/timeout-risk-audit.sh

仓库/工作流过滤:

bash
RUN_GLOB=artifacts/github-actions/*.json \
REPO_MATCH=^flowcreatebot/ \
WORKFLOW_MATCH=(CI|Build) \
bash skills/github-actions-timeout-risk-audit/scripts/timeout-risk-audit.sh

使用捆绑的测试数据运行:

bash
RUN_GLOB=skills/github-actions-timeout-risk-audit/fixtures/*.json \
bash skills/github-actions-timeout-risk-audit/scripts/timeout-risk-audit.sh

输出约定

  • - 报告模式下退出码为0
  • 当FAILONCRITICAL=1且存在至少一个严重实例时退出码为1
  • 文本输出包含摘要、阈值和超时风险最高的作业
  • JSON输出包含summary、排序后的groups和critical_instances

标签

skill ai

通过对话安装

该技能支持在以下平台通过对话安装:

OpenClaw WorkBuddy QClaw Kimi Claude

方式一:安装 SkillHub 和技能

帮我安装 SkillHub 和 github-actions-timeout-risk-audit-1776200994 技能

方式二:设置 SkillHub 为优先技能安装源

设置 SkillHub 为我的优先技能安装源,然后帮我安装 github-actions-timeout-risk-audit-1776200994 技能

通过命令行安装

skillhub install github-actions-timeout-risk-audit-1776200994

下载

⬇ 下载 github-actions-timeout-risk-audit v1.0.0(免费)

文件大小: 6.19 KB | 发布时间: 2026-4-15 12:37

v1.0.0 最新 2026-4-15 12:37
Initial release – audit GitHub Actions jobs for timeout risks.

- Calculates per-job runtime from GitHub Actions run JSON files.
- Flags jobs as `warn` or `critical` based on configurable timeout ratios.
- Groups repeated jobs for concise reporting.
- Supports configurable input filters and output formats (text or JSON).
- Can fail CI on critical timeout risks if desired.

Archiver·手机版·闲社网·闲社论坛·羊毛社区· 多链控股集团有限公司 · 苏ICP备2025199260号-1

Powered by Discuz! X5.0   © 2024-2025 闲社网·线报更新论坛·羊毛分享社区·http://xianshe.com

p2p_official_large
返回顶部