Can you set a hard spending limit on GitHub Actions?
Yes. GitHub budgets can stop usage of metered products such as Actions: if a budget with Stop usage when budget limit is reached is used up, additional usage is blocked. In GitHub's own example, an organization that hits its $50 Actions budget is blocked from all GitHub-hosted runners until the next billing cycle or until the budget goes up.
The catch is scope. A budget stops everything at once and can't single out the one workflow stuck in a loop. Actions is free for standard GitHub-hosted runners in public repositories and for self-hosted runners; private repositories get a monthly included amount, then pay. Prices and included minutes are in GitHub Actions pricing, and budget setup in GitHub Actions spending limit.
| Control | What it does | The gap |
|---|---|---|
| Budget with Stop usage | Blocks metered usage once the budget is used up | Stops every GitHub-hosted runner in the organization, not one workflow |
| Budget without Stop usage | Lets you monitor spend without blocking anyone | Nothing stops |
| Disable a workflow by hand | Stops new triggers of that workflow | Existing runs keep going until you cancel them |
| Costbrake | Running-job estimates every 5 minutes, spike alerts, both brakes | An admin confirms every brake; no faster checks in a spike |
What Costbrake reads from GitHub
Billed dollars come from GitHub's billing usage report, which needs read access to Organization Administration for an organization or to Account Plan for a personal account. Running Actions jobs are checked every 5 minutes and priced at list price until they show up in the bill. Seat and license charges arrive daily.
Polling uses up to about 450 of the 5,000 API requests per hour a token gets. When fewer than 750 are left, Costbrake slows to every 15 minutes so your own automation keeps its share.
The GitHub token and the GitHub App
The fastest setup is one click: install the Costbrake GitHub App and approve read access; the same install signs you in. If you can't install apps, generate a fine-grained token from the pre-filled link Costbrake gives you: read-only Organization Administration or Account Plan, plus Repository Actions. GitHub only creates fine-grained tokens in the browser, so your AI agent prepares the link and you click Generate, as described in agent setup. Classic tokens are not accepted.
Brakes need write access, so they use a separate install of the Costbrake Brakes app or a separate fine-grained token with Repository Actions read and write. The $0 budget brake also needs Organization Administration read and write.
How a GitHub brake works
Costbrake never brakes on its own. On Pro and Team, an admin turns the killswitch on for the connection, picks a workflow or the organization budget, types the connection name and clicks Brake now. GitHub's disable doesn't cancel runs that already started, so the workflow brake cancels them too and force-cancels any that keep going. For how loops start, see runaway GitHub Actions workflows.
- The $0 budget brake needs an organization; personal accounts get the workflow brake only.
- Undo re-enables the workflow but doesn't restart cancelled runs.
- There is no brake for other metered GitHub products; for those, Costbrake alerts and you act on GitHub.
What triggers a GitHub alert
A spike alert fires when an hour costs more than 3 times your 7-day hourly average and at least $5 more, once Costbrake has 24 hours of history. Budget alerts fire at 50, 80 and 100 percent by default, and Pro adds forecast alerts. Free sends email; Pro adds Slack, Discord and webhooks; Team adds PagerDuty. Compare plans on the pricing page.
Questions and answers
Does Costbrake stop GitHub Actions spend automatically?
No. Costbrake alerts you, and an admin on Pro or Team decides whether to brake. A brake needs the killswitch turned on for the connection, the connection name typed in, and a click on Brake now. Every brake has an Undo.
Is the Costbrake GitHub token read-only?
Yes. The read token or app only has read access to billing (Organization Administration or Account Plan) and to Repository Actions. Brakes use a separate app install or a separate token with write access that you only add if you want brakes.
How quickly does Costbrake see a runaway GitHub Actions workflow?
On Pro and Team, Costbrake checks running Actions jobs every 5 minutes and prices them at list price before GitHub bills them. GitHub checks don't speed up during a spike, and they slow to every 15 minutes when the token has fewer than 750 API requests left in the hour.
Does disabling a GitHub workflow cancel its running jobs?
Not on GitHub's side: disabling a workflow doesn't cancel its existing runs. The Costbrake workflow brake disables the workflow and also cancels its queued and running runs, force-cancelling any that keep going.
Can I use the $0 Actions budget brake on a personal account?
No. The budget brake sets an organization budget, so it only appears for organization accounts. Personal accounts get the workflow brake.
Sources
Updated