actions-billing-usage
БесплатноБез исполняемых скриптовНе проверенMeasure GitHub Actions cost with the billing-usage API — per repo, month and SKU; net vs gross; per-job rounding; budgets and their hard stop. Use when…
от laurigates★ 61 звезда на GitHubОб этом скилле
Before Optimizing CI Cost, Read the Billing-Usage API
Promoted from the always-loaded ci-cost-read-the-billing-api.md portfolio
rule, whose stub keeps the gate line.
Any "make CI cheaper / faster" task starts with a guess about where the cost is, and across a portfolio that guess is reliably wrong. The intuition follows where the interesting work is (the private repos, the big builds); the actual minutes follow how often a workflow fires, which is dominated by automation nobody thinks of as expensive. GitHub will tell you exactly, per repo, per month, per SKU — ask it first, then optimize.
When to Use This Skill
| Use this skill when... | Skip when... |
|---|---|
| A runner-tier, concurrency, caching, or scheduling change is pitched as a cost or speed win | The target is a single known-slow workflow you are already measuring directly |
| About to remove a workflow "because it must be expensive" | |
| A bill moved and the cause isn't obvious — the per-repo × per-month breakdown localizes it in one call | |
| Adding automation, to decide whether it gets its own job | |
| Every job in an org fails at once with no steps and no log — see Budgets |
The endpoint (the obvious one is gone)
gh api "/users/<user>/settings/billing/usage"
/users/<user>/settings/billing/actions— the endpoint most examples and most recall still name — now returns HTTP 410 "This endpoint has been moved." That 410 is easy to misread as "no billing data available on this plan" and skip the measurement entirely.
Org equivalent of the working endpoint: /orgs/<org>/settings/billing/usage.
Aggregate before reading; the raw response is one row per repo × month × SKU:
gh api "/users/<u>/settings/billing/usage" --jq '[.usageItems[] | select(.product=="actions" and .unitType=="Minutes")] | group_by(.repositoryName) | map({repo:.[0].repositoryName, minutes:(map(.quantity)|add), net:(map(.netAmount)|add)}) | sort_by(-.minutes)'
Reading it correctly
The filter takes the bare repo name, not
owner/repo.select(.repositoryName == "<owner>/<repo>")returns[], which is indistinguishable from "this repo bills nothing";"<repo>"returns the rows. The owner-qualified filter has reported nothing for a repo billing thousands of minutes that month, and a cost argument was nearly built on that empty result. Control-test an empty billing filter against a repo you know is active before believing it.netAmount, notgrossAmount, is the spend. Public-repo minutes are free and unlimited, so their rows readgrossAmount == discountAmountandnetAmount == 0. A repo showing a large gross may be costing nothing — but it's still where a runner-tier change would pay off once charges begin, so read both: gross for exposure, net for current spend.Group by SKU too (
Actions LinuxvsActions Linux SlimvsActions macOS 3-core) — it reveals which tiers are already in use and theirpricePerUnit, so the cheaper-runner arithmetic needs no lookup.Read the monthly trend, not just the total. A flat annual figure hides an exponential; the decision usually turns on the slope.
The default response is windowed — the obvious call will not give you the trend. A bare
/orgs/<org>/settings/billing/usagereturns only a slice (observed 2026-08: Jan–Feb only, for a repo with a full year of activity), and nothing in the payload says it was truncated. Build the trend from explicit per-month calls and let the months you asked for be the months you got:for m in $(seq 1 12); do gh api "/orgs/<org>/settings/billing/usage?year=2026&month=$m" --jq "[.usageItems[] | select(.product==\"actions\" and .unitType==\"Minutes\" and .repositoryName==\"<repo>\")] | map(.quantity) | add // 0" ; doneRead the outcome distribution, not just the minutes. Minutes tell you something is expensive; outcomes tell you whether you are buying anything. An E2E suite billing close to an hour per run while
cancel-in-progresskilled it about halfway through succeeded a few percent of the time. "Expensive" argues for a cheaper runner; "expensive and almost never succeeding" argues for deleting or fixing the workflow. Same bill, different decision. Pull conclusions alongside cost:gh run list -R <owner>/<repo> --workflow <name> -L 400 --json conclusion --jq 'group_by(.conclusion) | map({(.[0].conclusion // "null"): length}) | add'/actions/workflows/<id>/timingis empty for public repos — billable ms is only populated where minutes are billed. Approximate per-workflow cost instead:gh run list -R <owner>/<repo> -L 400 --json workflowName,startedAt,updatedAtthen group durations by
workflowName. Good enough to rank; don't quote it as billing truth — run wall-clock includes queue and finalisation time that is not billed, so it *
Установить actions-billing-usage в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Bash(gh api *)Bash(gh run list *)Bash(jq *)ReadTodoWriteFAQ
Что делает скилл actions-billing-usage?
Measure GitHub Actions cost with the billing-usage API — per repo, month and SKU; net vs gross; per-job rounding; budgets and their hard stop. Use when optimizing CI cost or speed, before removing a workflow as expensive, or when jobs fail with zero steps because a budget ran out.
Как установить скилл actions-billing-usage?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл actions-billing-usage запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
mcp-builder
Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when…
от Anthropicclaude-api
Reference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER…
от Anthropicalgorithmic-art
Creating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code…
от Anthropicmcp-integration
This skill should be used when the user asks to "add MCP server", "integrate MCP", "configure MCP in plugin", "use .mcp.json", "set up Model Context…
от Anthropic