spendtron · Guide

How to cut GitHub Actions minutes, in the order it usually pays off

Most CI bills have a few big causes, not many small ones: one expensive runner, or one workflow firing far more often than it needs to. So measure first, then work down this list from the top. Each item says what it saves and what it risks.

0. Find the expensive workflow

Get the detailed usage report and rank by workflow. It's common for one workflow to be a third or more of everything. Fix that one before touching the rest.

1. Put expensive runners only where they're needed

A macOS minute costs about 10× a Linux minute, and larger runners cost about 2× to 90× the 2-core Linux rate (full table). Moving one job off the wrong runner often beats every other change combined. See keeping macOS off every pull request. On public repositories, standard runners are free but larger runners are not, so a short job on an 8-core runner there is pure cost.

2. Don't run the workflow for changes it can't affect

A docs-only commit shouldn't run the full test suite. Add a path filter:

on:
  push:
    branches: [main]
    paths-ignore:
      - "**/*.md"
      - "docs/**"
  pull_request:
    paths-ignore:
      - "**/*.md"
      - "docs/**"

Risk: if branch protection requires this workflow's checks, a skipped run can leave a pull request waiting on a check that never reports. Check your required checks before filtering a required workflow.

3. Cancel runs that a newer push replaced

Push three times to a pull request and, by default, all three runs finish. Only the last one matters.

concurrency:
  group: ${{ github.workflow }}-${{ github.ref }}
  cancel-in-progress: ${{ github.event_name == 'pull_request' }}

Cancelling only on pull_request means a push to main always finishes. Don't add this to a workflow that deploys: cancelling a deploy partway can leave it half-applied.

4. Stop running the same commit twice

A workflow with both push and pull_request and no branch filter runs twice for every push to a pull request's branch. Limit push to the branches you merge into:

on:
  push:
    branches: [main]
  pull_request:

5. Narrow the matrix on pull requests

Each matrix cell is a separate job, billed separately and rounded up separately. Three OS versions × four language versions is twelve jobs on every push. Pull requests usually need the newest and oldest supported versions on Linux. The full grid can run on main or on a schedule.

6. Merge tiny jobs

Each job rounds up to a whole minute. A lint job that takes 12 seconds bills a minute, and so do the format check and type check next to it. If they share a setup, run them as steps in one job.

7. Cache what you download every run

Browser installs are the classic case. npx playwright install can take a minute every run. Cache ~/.cache/ms-playwright, keyed on your lockfile, with actions/cache. Cypress caches to ~/.cache/Cypress. Most setup-* actions can also cache package downloads with their cache: input.

8. Set a timeout

timeout-minutes doesn't make a healthy run any shorter. It caps a hung job, which otherwise bills until GitHub's six-hour default limit. Set it comfortably above your slowest normal run, around 1.5× to 3×, so it never cuts off a real build.

Before you start

Check whether there's money to save. If your month's net usage is inside your plan's included compute ($12, $18, or $300, depending on plan), the invoice is already $0 and these changes buy speed, not savings. That can still be worth it. Just know which one you're doing.

See which of your workflows costs what.

Drop GitHub's detailed usage report into spendtron and get a chart by workflow and runner. It's read in your browser, nothing is uploaded, and it's free.

Free tools: Workflow checker · Cost calculator · Self-hosted break-even · Larger runners
More guides: Runner pricing · macOS runner cost · The usage report · Cutting minutes
Rates and plan details from GitHub's documentation, checked November 2026. GitHub changes them; its pricing page is the authority.