GitHub Actions Cancel Waste Audit

👤 daniellummis 📦 v1.0.0 ⭐ 4.4 ⬇️ 766 下載
🔒 IT運維與安全 免費

📖 技能介紹


name: github-actions-cancel-waste-audit description: Audit cancelled and timed-out GitHub Actions runs from JSON exports to surface wasted CI minutes and noisy workflows. version: 1.0.0 metadata: {"openclaw":{"requires":{"bins":["bash","python3"]}}}


GitHub Actions Cancel Waste Audit

Use this skill to quantify wasted GitHub Actions runtime from cancelled or timed-out runs so flaky workflow churn gets fixed before it burns CI budget.

What this skill does

  • Reads one or more GitHub Actions run JSON exports (gh api output)
  • Estimates wasted runtime minutes per run (run_started_at/created_at -> updated_at)
  • Groups waste by repository + workflow + conclusion for fast triage
  • Flags warn/critical waste levels using configurable minute thresholds
  • Supports text and JSON output for terminal checks or dashboards

Inputs

Optional: - RUN_GLOB (default: artifacts/github-actions-runs/*.json) - TOP_N (default: 20) - OUTPUT_FORMAT (text or json, default: text) - WARN_WASTED_MINUTES (default: 15) - CRITICAL_WASTED_MINUTES (default: 45) - FAIL_ON_CRITICAL (0 or 1, default: 0) - REPO_MATCH (regex, optional) - REPO_EXCLUDE (regex, optional) - WORKFLOW_MATCH (regex, optional) - WORKFLOW_EXCLUDE (regex, optional) - BRANCH_MATCH (regex, optional) - BRANCH_EXCLUDE (regex, optional) - ACTOR_MATCH (regex, optional) - ACTOR_EXCLUDE (regex, optional) - CONCLUSION_MATCH (regex, optional, default behavior already includes only cancelled/timed_out) - CONCLUSION_EXCLUDE (regex, optional)

Collect run JSON

Single repository:

gh api repos/<owner>/<repo>/actions/runs --paginate \
  > artifacts/github-actions-runs/<owner>-<repo>.json

Run

Text report:

RUN_GLOB='artifacts/github-actions-runs/*.json' \
WARN_WASTED_MINUTES=20 \
CRITICAL_WASTED_MINUTES=60 \
bash skills/github-actions-cancel-waste-audit/scripts/cancel-waste-audit.sh

JSON output for automation:

RUN_GLOB='artifacts/github-actions-runs/*.json' \
OUTPUT_FORMAT=json \
FAIL_ON_CRITICAL=1 \
bash skills/github-actions-cancel-waste-audit/scripts/cancel-waste-audit.sh

Filter to one repo/workflow family:

RUN_GLOB='artifacts/github-actions-runs/*.json' \
REPO_MATCH='^flowcreatebot/' \
WORKFLOW_MATCH='(test|build)' \
BRANCH_MATCH='^(main|release)' \
bash skills/github-actions-cancel-waste-audit/scripts/cancel-waste-audit.sh

Run with bundled fixtures:

RUN_GLOB='skills/github-actions-cancel-waste-audit/fixtures/*.json' \
bash skills/github-actions-cancel-waste-audit/scripts/cancel-waste-audit.sh

Output contract

發現更多技能外掛,請訪問7w4.net。

  • Exit 0 in reporting mode (default)
  • Exit 1 if FAIL_ON_CRITICAL=1 and at least one run has waste at/above CRITICAL_WASTED_MINUTES
  • In text mode: prints summary and top waste hotspots
  • In json mode: prints summary, grouped stats, and critical run instances

🤖 AI 評測

這個 Skill 質量中等偏上。功能實用,能有效統計 GitHub Actions 中被取消或超時的執行浪費了多少時間,並按倉庫和工作流分組展示結果。文件清晰,引數驗證完善,支援文本和 JSON 兩種輸出格式。主要不足是缺少自動化測試,生產使用有一定風險,建議等待補充測試後再大規模採用。

📊 多維度評分

適應性4.2
規範性4.2
有效性4.7
可靠性4.7
可信度4.2

📁 包含檔案 (5 個)

📄 SKILL.md 2.8 KB
📄 _meta.json 152 B
📄 fixtures/runs-repo-a.json 1.6 KB
📄 fixtures/runs-repo-b.json 1.7 KB
📄 scripts/cancel-waste-audit.sh 13.2 KB