runs-on in GitHub Actions: choosing the runner for a job
How runs-on picks a runner: GitHub-hosted labels, self-hosted label arrays, runner groups, and choosing the runner from a matrix or an expression.
In this series24 guides, you're on runs-on
runs-on is required on every job (except jobs that call a reusable workflow). It tells GitHub which machine, the runner, should run the job. It takes one of three forms, shown here in three jobs:
jobs: lint: runs-on: ubuntu-latest # one label build: runs-on: [self-hosted, linux, arm64] # several labels: a runner must have all of them release: runs-on: # a runner group, optionally with labels group: large-runners labels: [linux-16-core]GitHub sends the job to a runner whose labels match. If none is online, the job waits in the queue: up to 24 hours for self-hosted runners before it is cancelled.
GitHub-hosted labels#
Each label is a fresh virtual machine, deleted when the job ends; ubuntu-slim is a fresh container instead, meant for short automation jobs such as labelling or triage, not builds. The current labels:
| Label | OS | CPU (private / public repo) | RAM (private / public) |
|---|---|---|---|
ubuntu-latest, ubuntu-24.04, ubuntu-22.04 (deprecated), ubuntu-26.04 | Linux x64 | 2 / 4 | 8 / 16 GB |
ubuntu-24.04-arm, ubuntu-22.04-arm (deprecated), ubuntu-26.04-arm | Linux arm64 | 2 / 4 | 8 / 16 GB |
ubuntu-slim | Linux x64, 1 vCPU container: 15-minute job limit, no Docker-in-Docker | 1 | 5 GB |
windows-latest, windows-2025, windows-2025-vs2026, windows-2022 | Windows x64 | 2 / 4 | 8 / 16 GB |
windows-11-arm, windows-11-vs2026-arm | Windows arm64 | 2 / 4 | 8 / 16 GB |
macos-latest, macos-15, macos-26, xcode-27 | macOS arm64 (M1) | 3 | 7 GB |
macos-15-intel, macos-26-intel | macOS x64 | 4 | 14 GB |
The -vs2026 labels name the Windows images with Visual Studio 2026 explicitly. As of November 2026, GitHub lists windows-2025-vs2026 for public repositories only, and xcode-27, a macOS 27 image with Xcode 27, is in public preview.
These runners are free in public repositories. In private repositories they draw from your plan’s included compute and are then billed per minute, from $0.002 for ubuntu-slim to $0.062 for macOS (GitHub’s prices ↗).
Every one of them has 14 GB of SSD storage. The -latest labels move to a new OS version a few months after it ships, which can break a workflow overnight. GitHub moves ubuntu-latest from Ubuntu 24.04 to Ubuntu 26.04 gradually between October 19 and November 19, 2026 ↗; during that window a run can land on either. Pin ubuntu-24.04 or ubuntu-26.04 to move on your own schedule. Pinning fixes the OS release, not the preinstalled tools, which GitHub updates weekly: pin the ones you depend on with setup-* actions.
ubuntu-22.04 and ubuntu-22.04-arm have been deprecated since September 17, 2026, and are unsupported from April 17, 2027. GitHub keeps the authoritative list in its runner reference ↗.
A label doesn’t say which cloud runs the job: standard 2-core and 4-core Linux jobs can run on AWS or Microsoft Azure (multi-cloud compute ↗, automatic on Free, Pro and Team, opt-in on Enterprise Cloud), so an IP allowlist must include every range GitHub publishes for Actions, not only Azure’s.
Bigger machines (up to 96 vCPUs, GPUs) are larger runners, on the Team and Enterprise Cloud plans. For Linux and Windows, an organization admin creates them, and you target them by the name they were given or by their runner group. macOS sizes need no setup: macos-latest-large (Intel) or macos-latest-xlarge (M2).
Self-hosted labels#
A self-hosted runner gets default labels when it registers, unless you pass --no-default-labels: self-hosted, its OS (linux, windows or macOS) and its architecture (x64, ARM or ARM64). You add custom labels at registration (--labels gpu,large) or in the settings. With an array, the job goes to a runner that has every label:
jobs: build: runs-on: [self-hosted, linux, x64, gpu]Labels are case-insensitive. Keep them specific: a job asking only for self-hosted can land on any of your runners, including the slow one under someone’s desk.
Runners in an ARC scale set get none of the default labels, not even self-hosted, so a job asking for self-hosted never lands on them. Target them by the scale set’s name or by the labels you gave it.
Runner groups#
Organizations put runners in groups to control which repositories can use them. Target a group with group:, alone or with labels:
runs-on: group: large-runners labels: linux-16-coreThe job only goes to runners of that group that also have the labels. Group access is checked first: a repository that isn’t allowed to use the group never gets its jobs picked up, and the job sits queued.
An organization or enterprise admin can also disable standard GitHub-hosted runners ↗, in the “Standard hosted runners” section of the Actions settings. Jobs must then target runners through runner groups instead of labels such as ubuntu-latest.
Choosing the runner dynamically#
runs-on accepts expressions, which is how one job definition covers several machines.
From a matrix:
jobs: test: strategy: matrix: os: [ubuntu-24.04, ubuntu-24.04-arm, windows-latest, macos-latest] runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v7 - run: make testTo mix fixed labels and an expression in an array, quote the expression: runs-on: [self-hosted, linux, "${{ matrix.arch }}"]. Without the quotes, ${{ breaks the YAML array and the workflow file is invalid.
From the event or an input:
on: push: workflow_dispatch: inputs: runner: type: choice options: [ubuntu-24.04, ubuntu-24.04-arm]
jobs: build: # Manual run: the runner picked in the form. Push: linux-16-core on main # (a larger runner, Team or Enterprise Cloud only), ubuntu-latest elsewhere runs-on: ${{ inputs.runner || (github.ref == 'refs/heads/main' && 'linux-16-core') || 'ubuntu-latest' }}On a push the input is empty, so the branch decides. The input comes first because a manual run uses the default branch unless you pick another one: with the branch test first, the choice in the form would be ignored on main.
From a configuration variable, so a repository setting can move every workflow to another runner without a commit:
runs-on: ${{ vars.DEFAULT_RUNNER || 'ubuntu-latest' }}From an earlier job’s output, when picking the runner takes a script (needs is available in runs-on):
jobs: pick: runs-on: ubuntu-latest outputs: runner: ${{ steps.pick.outputs.runner }} steps: - uses: actions/checkout@v7 - id: pick run: | runner=$(./scripts/pick-runner.sh) # your own logic, prints a label echo "runner=$runner" >> "$GITHUB_OUTPUT"
test: needs: pick runs-on: ${{ needs.pick.outputs.runner }} steps: - uses: actions/checkout@v7 - run: make testruns-on has no fallback: a job waits for a runner that has all its labels. To fall back from your own runners to GitHub’s, decide in an earlier job like pick: output self-hosted when your runners are available and ubuntu-latest otherwise.
And when the labels themselves vary, build the array from JSON in a variable or a job output: runs-on: ${{ fromJSON(vars.RUNNER_LABELS) }}, with RUNNER_LABELS set to ["self-hosted", "linux", "x64"].
Reading the runner from a step#
Inside a job, the runner context and the RUNNER_* variables tell you where you landed: runner.os (Linux, Windows, macOS), runner.arch (X64, ARM64…), runner.name, and runner.environment (github-hosted or self-hosted). Use them in cache keys (${{ runner.os }}-${{ runner.arch }}-…) so x64 and arm64 jobs don’t share incompatible caches.
Things that go wrong#
- “Waiting for a runner to pick up this job” until GitHub fails the job after 24 hours. No online runner has all the labels (check the spelling; case doesn’t matter), the repository can’t use the runner’s group (public repositories can’t use an organization’s runner groups until the group’s settings allow them), or you hit your plan’s concurrency limit. Larger runners also need a payment method on file and a spending limit above zero.
- Jobs queued at the concurrency limit. On standard GitHub-hosted runners, an account runs at most 20 jobs at once on GitHub Free, 40 on Pro, 60 on Team and 500 on Enterprise, including up to 5 macOS jobs (50 on Enterprise). Larger runners allow 1,000 concurrent jobs, up to 100 of them on GPU runners; macOS larger runners count against the macOS cap instead. Further jobs wait in the queue; GitHub Support can raise the job concurrency limits ↗.
- A label that silently changed meaning.
ubuntu-latestandmacos-latestmove between OS versions. Pin versions for release builds. - Arm64 builds on x64. If a job uses QEMU to build arm64 images on
ubuntu-latest, switching it toubuntu-24.04-armusually makes it several times faster. See the matrix guide. runs-onon a reusable workflow call. A job withuses: ./.github/workflows/x.ymltakes noruns-on; the called workflow’s jobs choose their own runners. To choose from the caller, pass the label as an input and useruns-on: ${{ inputs.runner }}in the called workflow.
On RunsOn#
RunsOn runs your jobs on EC2 instances in your own AWS account, and its labels describe the machine you want, per job:
jobs: build: runs-on: runs-on=${{ github.run_id }}/runner=16cpu-linux-arm64The first part ties the runner to this workflow run; the rest picks the size, the architecture, the image and the disk. Any Linux or Windows EC2 type works, from 1 to 896 vCPUs, GPUs included. macOS runners aren’t supported, so keep macos-* jobs on GitHub-hosted runners. A label can also add opt-in features: extras=s3-cache, for example, turns on Magic Cache when the job also runs runs-on/action@v2. See job labels for every option.
When several jobs or matrix entries of a run use RunsOn, make the first part unique to each, with the job name, the run attempt (for re-runs) and, in a matrix, strategy.job-index: runs-on=${{ github.run_id }}-build-${{ github.run_attempt }}-${{ strategy.job-index }}/runner=16cpu-linux-arm64. Otherwise GitHub can give the runner launched for one job to another, and the job left without one can wait two minutes or more for a replacement (runner stealing).
These are Flex labels. With Fleet, the label instead names a runner your platform team publishes, such as runs-on/fleet=linux-small/env=production (see Flex vs Fleet).