How does GitHub-hosted runner billing actually work?
GitHub-hosted runners are the default because they remove an entire category of work. Each job gets a fresh, GitHub-managed virtual machine with a preinstalled toolchain. There are no hosts to patch, no images to maintain, no autoscaler to tune, and no leftover state between jobs. You pay for that convenience by the minute, so the billing model shapes every cost comparison later in this article.
The billing mechanics
Charges accrue per job, not per workflow. Each job's runtime is rounded up to the next whole minute. A workflow that fans out into 20 jobs of 10 seconds each is billed as 20 minutes, not about 3. This is why matrix-heavy pipelines often cost more than their wall-clock time suggests.
The per-minute rate depends on two factors:
| Factor | How it affects cost |
|---|---|
| Operating system | Linux is the baseline. Windows and macOS minutes are weighted with multipliers, so they consume included minutes faster or cost more per minute. |
| Machine size | Larger runners with more vCPUs, more memory, or GPUs carry higher per-minute rates. They may be billed separately from the included allowance. |
| Repository visibility | Standard hosted runners on public repositories are generally free. Private repositories draw down the plan's allowance. |
| Plan | Each plan includes a monthly quota of minutes and storage. Usage beyond the quota is billed if your spending limit allows it. |
Do not hardcode rates or allowances into your model. GitHub has changed both over time. Pull current figures from GitHub's official pricing page and billing documentation before you run any numbers.
How do you measure your real CI minutes cost before modeling anything?
Model inputs should come from your own job history. Averages from a dashboard hide the two things that drive self-hosting economics: how jobs cluster in time, and how many of them are short.
The REST API exposes what you need. List runs per repository with GET /repos/{owner}/{repo}/actions/runs, then fetch each run's jobs with GET /repos/{owner}/{repo}/actions/runs/{run_id}/jobs. You can call both through gh api --paginate. Each job record includes labels, runner_name, created_at, started_at and completed_at. The runner label tells you the OS and size, which determines the per-minute rate.
From those fields, derive four numbers per label and repository:
- Billed minutes:
ceil((completed_at − started_at) / 60)per job, summed. Billing rounds up each job, not each run. - Queue time:
started_at − created_at. Long queues on hosted runners suggest you are hitting concurrency limits. Long queues on self-hosted runners mean you are under-provisioned. - Peak concurrency: sort job start and end events and sweep through them, tracking how many jobs are running at once. This number sets your fleet size, not your average load.
- Rounding overhead: billed minutes minus actual minutes.
Illustrative estimate (assumed numbers, not a benchmark): assume 3,000 lint and unit jobs per day, each averaging 70 seconds.
- Actual time: 3,000 × 70 / 60 = 3,500 minutes.
- Billed time: 3,000 × 2 = 6,000 minutes.
- Overhead: (6,000 − 3,500) / 3,500 ≈ 71%.
That overhead disappears on self-hosted capacity, so measure it before you compare costs.
# Pull job timings via the GitHub CLI and aggregate cost inputs per (repo, runner labels).
import json, math, subprocess
from collections import defaultdict
from datetime import datetime
REPO = "example-org/example-repo" # placeholder; loop over repos for an org-wide view
SINCE = "2026-10-01"
def gh(path, jq):
# --paginate follows Link headers; --jq emits one value per line
out = subprocess.run(["gh", "api", "--paginate", path, "--jq", jq],
check=True, capture_output=True, text=True).stdout
return [line for line in out.splitlines() if line]
def ts(s): return datetime.fromisoformat(s.replace("Z", "+00:00"))
stats = defaultdict(lambda: {"jobs": 0, "actual": 0.0, "billed": 0, "queue": 0.0, "events": []})
for run_id in gh(f"repos/{REPO}/actions/runs?per_page=100&created=>={SINCE}", ".workflow_runs[].id"):
# filter=all includes jobs from earlier attempts, which also consumed minutes
for line in gh(f"repos/{REPO}/actions/runs/{run_id}/jobs?per_page=100&filter=all", ".jobs[] | @json"):
job = json.loads(line)
if not job.get("started_at") or not job.get("completed_at"):
continue # queued, in progress, or never started
created, start, end = ts(job["created_at"]), ts(job["started_at"]), ts(job["completed_at"])
s = stats[(REPO, ",".join(sorted(job["labels"])))] # labels imply OS and size
secs = max((end - start).total_seconds(), 0)
s["jobs"] += 1
s["actual"] += secs / 60
s["billed"] += math.ceil(secs / 60) # each job rounds up to a whole minute
s["queue"] += max((start - created).total_seconds(), 0)
s["events"] += [(start, 1), (end, -1)]
for (repo, labels), s in stats.items():
running = peak = 0
for _, delta in sorted(s["events"]): # at equal timestamps, ends (-1) sort before starts
running += delta
peak = max(peak, running)
overhead = (s["billed"] - s["actual"]) / s["actual"] * 100 if s["actual"] else 0
print(f"{repo} [{labels}] jobs={s['jobs']} actual={s['actual']:.0f}m billed={s['billed']}m "
f"rounding={overhead:.0f}% avg_queue={s['queue'] / s['jobs']:.0f}s peak_concurrency={peak}")
A Python script that pulls workflow run and job timing data through gh api --paginate and reports billed minutes, rounding overhead, average queue time and peak concurrency for each repository and runner label set.
What does a self-hosted runner really cost to run?
A self-hosted runner is a machine you supply (a VM, a bare-metal host, or a Kubernetes pod) that runs GitHub's runner agent, registers with a repository or organization, and pulls jobs from the queue. You stop paying for rounded hosted minutes, but you now pay for every layer underneath each job.
| Component | What drives the cost | Why it gets missed |
|---|---|---|
| Compute instances or nodes | Instance size × hours running, including idle time | Idle capacity bills whether jobs run or not |
| Storage and cache volumes | Disk size, IOPS, and snapshot retention | Volumes outlive the instances they were attached to |
| Network egress | Artifact uploads, cross-zone traffic, NAT gateways | It arrives on a separate line of the cloud bill |
| Container registry pulls | Image size × pull frequency, plus rate limits | Ephemeral runners pull images again on every start |
| Monitoring and logging | Log ingestion volume and metric cardinality | Verbose build logs grow quickly |
| Engineering time | Image patching, runner upgrades, disk cleanup, on-call | It never appears on an invoice |
Engineering time is usually the largest item. Caches and Docker layers fill disks until jobs fail. The runner agent must stay current or it stops accepting jobs. Base images need security patches. Every one of these failures is shared. When CI goes down, every team is blocked, so a runner outage becomes an incident that pages someone.
You also lose parity with hosted images. Workflows often assume preinstalled tooling such as language runtimes, CLIs, and browsers. Once you self-host, you build and maintain custom images that provide that tooling yourself.
To total it up:
Monthly cost = compute + storage + egress + registry + observability + (maintenance hours × loaded hourly rate)
Where is the break-even point, and how does utilization move it?
All figures below are illustrative estimates built from assumed inputs. They are not measured results or current prices.
Assumed inputs: 60,000 job minutes per month, peak concurrency of 10 jobs, an instance rate of $0.20/hour, a hosted rate of $0.008/minute, and an engineer cost of $100/hour.
At those rates, hosted minutes cost $480/month. Ten always-on instances sized for peak run 7,300 runner-hours a month. The jobs need only 1,000 of those hours, so utilization is about 14%. Most of what you pay for sits idle overnight and on weekends, because CI demand follows working hours and peak sizing covers the busiest weekday hour.
Autoscaling fixes most of the idle time. The table assumes 20% overhead on autoscaled hours to cover boot time and scale-down lag.
| Scenario | Monthly minutes | Runner-hours paid | Compute | Maintenance | Self-hosted total | Hosted |
|---|---|---|---|---|---|---|
| Always-on, 4 h maint. | 60,000 | 7,300 | $1,460 | $400 | $1,860 | $480 |
| Autoscaled, 8 h maint. | 60,000 | 1,200 | $240 | $800 | $1,040 | $480 |
| Autoscaled, 4 h maint. | 60,000 | 1,200 | $240 | $400 | $640 | $480 |
| Autoscaled, 2 h maint. | 60,000 | 1,200 | $240 | $200 | $440 | $480 |
| Autoscaled, 4 h maint. | 300,000 | 6,000 | $1,200 | $400 | $1,600 | $2,400 |
At 60,000 minutes, the answer depends on maintenance hours. A difference of two engineer-hours a month decides which option is cheaper. At higher volume, maintenance becomes a smaller share of the total, and self-hosting pulls ahead. Treat break-even as a range rather than a single number.
Rerun this model with current prices, your measured minutes, and an honest count of maintenance hours.
# Break-even model for self-hosted vs hosted CI runners.
# Every default below is an ILLUSTRATIVE ESTIMATE, not a current price.
# Replace them with current prices and your own measured data.
HOURS_PER_MONTH = 730
INSTANCE_RATE = 0.20 # $/runner-hour (assumed)
HOSTED_RATE = 0.008 # $/job-minute (assumed)
ENGINEER_RATE = 100.0 # $/engineer-hour (assumed)
AUTOSCALE_OVERHEAD = 0.20 # boot time + scale-down lag (assumed)
def monthly_costs(job_minutes, peak_concurrency, maint_hours, autoscaled):
job_hours = job_minutes / 60
if autoscaled:
# Pay roughly for job hours plus overhead.
runner_hours = job_hours * (1 + AUTOSCALE_OVERHEAD)
else:
# Always-on fleet sized for the busiest hour, idle nights and weekends.
runner_hours = peak_concurrency * HOURS_PER_MONTH
compute = runner_hours * INSTANCE_RATE
self_hosted = compute + maint_hours * ENGINEER_RATE
hosted = job_minutes * HOSTED_RATE
# Maintenance hours at which both options cost the same.
breakeven_maint = max(0.0, (hosted - compute) / ENGINEER_RATE)
util = job_hours / runner_hours
return runner_hours, util, self_hosted, hosted, breakeven_maint
scenarios = [
("always-on, 4h", 60_000, 10, 4, False),
("autoscaled, 8h", 60_000, 10, 8, True),
("autoscaled, 4h", 60_000, 10, 4, True),
("autoscaled, 2h", 60_000, 10, 2, True),
("autoscaled, 4h, 300k", 300_000, 10, 4, True),
]
for name, minutes, peak, maint, auto in scenarios:
rh, util, sh, ho, be = monthly_costs(minutes, peak, maint, auto)
winner = "self-hosted" if sh < ho else "hosted"
print(f"{name:22} runner-h={rh:6.0f} util={util:4.0%} "
f"self=${sh:6.0f} hosted=${ho:6.0f} "
f"break-even maint={be:4.1f}h -> {winner}")
A small Python model that reproduces the section's illustrative table, reports utilization, and computes the monthly maintenance hours at which self-hosting breaks even, so readers can rerun it with their own prices and measured minutes.
How does Actions Runner Controller autoscale ephemeral runners, and what does it cost to operate?
Actions Runner Controller (ARC) runs inside your Kubernetes cluster and watches GitHub for queued jobs that target its runner labels. When demand appears, it creates a runner pod. Each pod registers as an ephemeral runner, takes exactly one job, and is deleted when that job finishes. Every job starts from a clean environment, so no state carries over from a previous run.
Job → pod → node flow:
Queued job → ARC sees demand → runner pod created → pod scheduled onto a node with free capacity → if no node fits: pod stays Pending → node autoscaler requests a new VM → VM boots, joins the cluster, pulls the runner image → job runs → pod deleted → idle node eventually scaled down
The Pending branch is where cold starts come from. A pod on an existing node with a cached image starts quickly. A burst that exceeds current nodes waits for VM provisioning and image pulls on every step of that branch. During a large burst, queue times can be worse than on hosted runners, which already have capacity provisioned. You can keep a minimum number of warm runners or spare nodes to avoid this, but you pay for that idle capacity around the clock.
Operating costs are mostly engineering time:
- Cluster upkeep. You handle Kubernetes upgrades, node image patching, and monitoring. CI depends on cluster health, so a broken cluster blocks every deploy.
- Controller upgrades. ARC and its CRDs need upgrades that you test and roll out.
- Autoscaler tuning. You have to balance scale-down delays, instance types, and how aggressively idle nodes are removed.
Image builds are the hardest case. Docker-in-Docker usually needs privileged containers, which weakens isolation between jobs and the node. It also tends to lose layer caching when pods are ephemeral, so builds get slower.
+--------------------+ watches for +------------------------------+
| GitHub |<----------------| ARC controller (in cluster) |
| queued job | queued jobs | sees demand, creates pod |
+--------------------+ +--------------+---------------+
^ |
| registers as ephemeral v
| runner, takes 1 job +----------------------------+
+----------------------------| Runner pod (one job only) |
+-------------+--------------+
v
+-------------------------+
| Node has free capacity? |
+----+--------------+-----+
yes | | no
v v
+--------------------+ +-------------------------+
| Schedule on node | | Pending: cold start |
| cached image: fast | | autoscaler requests VM |
+---------+----------+ | VM boots, joins cluster |
| | pulls runner image |
| +------------+------------+
v |
+--------------------+ |
| Job runs |<---------------+
+---------+----------+
v
+-------------------------------------------+
| Pod deleted, idle node scaled down later |
| Warm nodes skip cold start, cost when idle|
+-------------------------------------------+
ARC turns each queued job into a single-use runner pod, and when no node has free capacity the pod waits in Pending while the node autoscaler boots a VM and pulls the image, which is the cold-start path that warm capacity avoids at the cost of paying for idle nodes.
When should you use spot capacity, and when should you avoid self-hosted runners entirely?
Spot or preemptible instances are typically priced well below on-demand, but the cloud provider can reclaim them at short notice. A reclaimed runner fails its job, and someone pays twice: once in compute for the lost work, and again in developer time spent waiting for the rerun.
Here is an illustrative estimate, with all inputs assumed. Say spot costs 40% of on-demand, and an interrupted job loses on average half its runtime before restarting. Short jobs with rare interruptions barely notice this. Now take a 90-minute job with a 30% interruption chance. Its expected compute rises about 15%, so it still costs less than on-demand. But each interruption adds roughly 45 minutes to someone's feedback loop. At engineering rates, that delay usually costs more than the compute you saved.
| Workload | Spot fit | Why |
|---|---|---|
| Stateless test shards | Good | Short, idempotent, cheap to retry |
| Lint and unit checks | Good | Minutes long, no side effects |
| Long release builds | Poor | Large rework, blocks releases |
| Deployments | Avoid | Partial runs can leave environments inconsistent |
Avoid self-hosting entirely in three cases:
- Public repos that accept fork pull requests. A malicious PR can run code on your host. It can read credentials, probe the internal network, or plant something that a later job will execute.
- Persistent runners. They leak workspace files, caches and tokens from one job into the next.
- Teams without capacity to operate the runner fleet.
Ephemeral runners destroy each machine after a single job. Network isolation blocks runners from reaching internal services. Both reduce the risk, but they add work: image pipelines, slower cold starts, egress rules and more moving parts to debug.
What are the cheaper alternatives to self-hosting, and how do they save engineering time?
Before taking on that work, check whether the bill shrinks with configuration changes alone. Most of these take an afternoon and need no new infrastructure.
- Path filters. A docs-only change should not trigger the full integration suite.
pathsandpaths-ignorestop runs that would never have caught a bug. - Concurrency groups with
cancel-in-progress. When a developer pushes three commits in quick succession, only the last run matters. Cancelling superseded runs removes minutes that produce no signal. - Dependency caching.
actions/cachekeyed on a lockfile hash skips repeated downloads and builds. These are often the largest fixed cost in a short job. - Merging tiny jobs. Hosted billing rounds each job up to the next whole minute. Six 20-second lint jobs bill as six minutes. Run as steps in one job, they take about two.
- Moving only the heaviest jobs. Send the slowest jobs to larger hosted runners or a small self-hosted pool. Leave everything else on standard runners.
The workflow example below combines the first three.
Speed is also a cost. Self-hosted runners can keep warm caches, pre-pulled images and low-latency access to internal artifact stores, which larger hosted runners cannot. Include developer waiting time when you compare options:
Illustrative estimate (assumed numbers, not a benchmark)
wait cost = runs/month × minutes saved per run × share of runs someone waits on × hourly rate ÷ 60
With 2,000 runs, 4 minutes saved per run, 50% of runs blocking someone and $90/hour:
2,000 × 4 × 0.5 × 90 ÷ 60 = $6,000/month
In that scenario, the waiting time can be worth more than the runner minutes saved.
name: ci
on:
pull_request:
# Skip the suite for docs-only changes
paths-ignore:
- 'docs/**'
- '**.md'
push:
branches: [main]
paths-ignore:
- 'docs/**'
- '**.md'
# One active run per branch or PR; a new push cancels the superseded run
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
# Restore the npm cache keyed on the lockfile; a lockfile change creates a new key
- uses: actions/cache@v4
with:
path: ~/.npm
key: npm-${{ runner.os }}-${{ hashFiles('package-lock.json') }}
restore-keys: |
npm-${{ runner.os }}-
- run: npm ci
# Lint and tests run as steps in one job, so per-job minute rounding applies once
- run: npm run lint
- run: npm test
A workflow that ignores docs-only changes, cancels superseded runs on the same branch, caches npm downloads by lockfile hash, and runs lint and tests in one job so per-job minute rounding applies only once.
Who should self-host? A hybrid decision framework
The decision rarely has to be all-or-nothing. Most organizations get the best result by splitting workloads by job type, because each type has a different cost profile and risk.
| Workload | Default choice | Why |
|---|---|---|
| Public repositories | Hosted | Standard hosted runners are free for public repos, and self-hosted runners there can execute untrusted code from fork pull requests |
| Low-volume or bursty workflows | Hosted | Idle self-hosted capacity costs money, while hosted billing stops when the job ends |
| macOS builds | Hosted | Apple's licensing requires Apple hardware, which is awkward to rack, patch and autoscale |
| High-volume Linux builds | Self-hosted | Steady utilization pushes you past break-even, and warm caches shorten runs |
| GPU or specialized hardware | Self-hosted | Hosted options may be limited or expensive, and you control drivers and toolchains |
| Jobs needing private network access | Self-hosted | Runners inside your network reach databases and internal registries without exposing them publicly |
Route jobs inside one organization with runner labels. Each job's runs-on value selects a pool. Hosted labels such as ubuntu-latest send work to GitHub. Custom labels you assign, such as self-hosted, linux and gpu, send work to your runners. Restrict self-hosted pools to specific repositories with runner groups so that only trusted repos can schedule onto them.
Treat the split as a model you rerun, not a permanent decision. Hosted pricing, your instance costs and your build volume all change. Every quarter, recompute per-label minutes and utilization against the break-even formula. Move workloads in either direction when the numbers cross the threshold.
How OneEnv can help
Disclosure: OneEnv is the product behind this blog.
OneEnv (oneenv.io) is a workspace-based governance platform for the things services share — environment variables, database structure, API routes and validation rules. A change to a shared value is staged on a branch, reviewed once, and then every affected service explicitly approves or rejects it before it goes live, so you can see who a change touches before it ships instead of finding out in production.
Applied to self-hosted github actions runners cost, this is where it helps:
Saves time
- Every service that inherits a shared value is listed in one place, so nobody searches repos and chats to find out who is affected.
- One review per branch replaces coordinating each team separately; each service still keeps its own approve/reject.
- Changing a shared variable is one edit and one review instead of editing every service's
.envby hand.
Saves cost
- Fewer production incidents and rollbacks caused by a shared value, route or column changing under a consumer unannounced.
- Less duplicated configuration to maintain: one shared definition inherited by many services.
- A wrong or stale value is caught at review time by the services it affects, not by a failed deploy.
- OneEnv has a free plan (1 workspace, unlimited services and members, full governance), so trying it costs nothing.
These are qualitative benefits, not measured results — how much you save depends on how many services share the value.
Want to try it? Start at oneenv.io.