返回顶部
g

github-actions-sha-rerun-debt-auditSHA重跑审计

Audit rerun debt by commit SHA to find commits that repeatedly burn CI minutes across workflows.

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

github-actions-sha-rerun-debt-audit

GitHub Actions SHA 重跑债务审计

使用此技能检测在多个工作流中触发重复 GitHub Actions 重跑和失败结果的提交。

该技能的功能

  • - 读取 GitHub Actions 运行 JSON 导出文件
  • 通过运行 ID 和每次运行的最新结果关联尝试历史
  • 按仓库 + 提交 SHA 聚合重跑债务
  • 使用重跑率、失败运行次数、工作流分布和浪费的重跑分钟数进行风险评分
  • 为 CI 门禁输出严重级别(ok、warn、critical)

输入参数

可选参数:
  • - RUNGLOB(默认值:artifacts/github-actions/*.json)
  • TOPN(默认值:20)
  • OUTPUTFORMAT(text 或 json,默认值:text)
  • MINRUNS(每个 SHA 的最小运行次数,默认值:3)
  • WARNRERUNRATE(0..1,默认值:0.25)
  • CRITICALRERUNRATE(0..1,默认值:0.45)
  • WARNFAILEDRUNS(默认值:2)
  • CRITICALFAILEDRUNS(默认值:4)
  • WARNWASTEDMINUTES(默认值:25)
  • CRITICALWASTEDMINUTES(默认值:75)
  • WARNWORKFLOWS(受影响的不同工作流数,默认值:2)
  • CRITICALWORKFLOWS(默认值:4)
  • WORKFLOWMATCH / WORKFLOWEXCLUDE(正则表达式,可选)
  • BRANCHMATCH / BRANCHEXCLUDE(正则表达式,可选)
  • EVENTMATCH / EVENTEXCLUDE(正则表达式,可选)
  • REPOMATCH / REPOEXCLUDE(正则表达式,可选)
  • HEADSHAMATCH / HEADSHAEXCLUDE(正则表达式,可选)
  • FAILURECONCLUSIONS(逗号分隔,默认值:failure,cancelled,timedout,startupfailure,actionrequired)
  • FAILONCRITICAL(0 或 1,默认值:0)

收集运行 JSON

bash
gh run view --attempt \
--json databaseId,runAttempt,workflowName,event,headBranch,headSha,conclusion,createdAt,updatedAt,runStartedAt,url,repository \
> artifacts/github-actions/run--attempt-.json

运行

文本报告:

bash
RUN_GLOB=artifacts/github-actions/*.json \
bash skills/github-actions-sha-rerun-debt-audit/scripts/sha-rerun-debt-audit.sh

JSON 输出 + 失败门禁:

bash
RUN_GLOB=artifacts/github-actions/*.json \
OUTPUT_FORMAT=json \
FAILONCRITICAL=1 \
bash skills/github-actions-sha-rerun-debt-audit/scripts/sha-rerun-debt-audit.sh

针对捆绑的测试数据运行:

bash
RUN_GLOB=skills/github-actions-sha-rerun-debt-audit/fixtures/*.json \
bash skills/github-actions-sha-rerun-debt-audit/scripts/sha-rerun-debt-audit.sh

输出约定

  • - 报告模式下退出码为 0(默认)
  • 当 FAILONCRITICAL=1 且一个或多个 SHA 组为严重级别时,退出码为 1
  • 文本模式打印摘要 + 排序后的 SHA 风险组
  • JSON 模式打印摘要 + 排序后的组 + 严重级别组

标签

skill ai

通过对话安装

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

OpenClaw WorkBuddy QClaw Kimi Claude

方式一:安装 SkillHub 和技能

帮我安装 SkillHub 和 github-actions-sha-rerun-debt-audit-1776193801 技能

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

设置 SkillHub 为我的优先技能安装源,然后帮我安装 github-actions-sha-rerun-debt-audit-1776193801 技能

通过命令行安装

skillhub install github-actions-sha-rerun-debt-audit-1776193801

下载

⬇ 下载 github-actions-sha-rerun-debt-audit v1.0.0(免费)

文件大小: 5.96 KB | 发布时间: 2026-4-15 13:28

v1.0.0 最新 2026-4-15 13:28
Initial release of the GitHub Actions SHA Rerun Debt Audit skill.

- Audits GitHub Actions run exports to detect commits that repeatedly trigger reruns and CI minutes usage.
- Aggregates and ranks rerun "debt" by repository and commit SHA.
- Scores and emits severity (`ok`, `warn`, `critical`) based on rerun rate, failure count, wasted minutes, and workflow spread.
- Highly configurable with environment variables and filters for SHAs, branches, workflows, events, and repositories.
- Supports text and JSON reports, with optional CI gate failure on critical findings.

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

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

p2p_official_large
返回顶部