
Runners vs. Runner groups
- Runner: a machine (VM, container, or physical host) that executes CI/CD jobs for GitHub Actions.
- Runner group: an organizational entity (organization or enterprise scoped) that groups runners and controls which repositories and workflows can use those runners.
- Create a runner group named
production-shared-group. - Install and register a Linux self‑hosted runner and assign it to that group.
- Allow one or more repositories to use the runner group and target the runner with workflow labels.
- Scope (which organizations can use the group).
- Whether public repositories are allowed to use the group.
Registration tokens are short‑lived. Generate the registration token from the GitHub UI immediately before registering a runner — tokens typically expire quickly (often around 1 hour).
Allowing self-hosted runners for public repositories is a security risk. External contributors (including forks) could run untrusted code on your infrastructure. Do not enable public repository access for self-hosted runners unless you understand and mitigate the security risks.
Create the runner group
Create a runner group (for example,production-shared-group) at the enterprise or organization level. You can use the default group, but creating a dedicated group helps with access control, visibility, and labels organization.
By default, an enterprise-shared group has no repositories allowed to use it — you must explicitly allow individual repositories or enable all repositories for that group.
Install and register a Linux self‑hosted runner
SSH into a Linux VM and perform these steps:- Create a directory for the runner.
- Download the official GitHub Actions runner package (replace the version if needed).
- Optionally validate the SHA256 checksum.
- Extract, configure (register) using the registration token, then run the runner.
v2.336.0 and the download URL if you need a newer version. Replace <RUNNER_TOKEN> with the registration token you obtained from GitHub.
./config.sh you’ll be prompted for:
- Runner group (press Enter for Default, or type
production-shared-group). - Runner name (for example,
prod-linux). - Additional labels (default:
self-hosted,Linux,X64; you can add custom labels likeprod-ubuntu). - Work folder (press Enter to accept
_work).
./run.sh. Example output indicating the runner is connected and listening:
Assign repository access to the runner group
At the organization level you can view enterprise-shared runner groups (e.g.,production-shared-group). From the runner group settings you must explicitly allow repositories to use the group — either select specific repositories (recommended) or allow all repositories.
Select the repository (for example ghks-gadrills-demo) to grant access to production-shared-group. If you want this group to serve multiple repositories, enable those repositories here.

Target the runner from a workflow
Runners advertise labels that workflows use to select execution targets. Default labels:self-hosted, Linux, X64. Add custom labels during configuration (for example, prod-ubuntu) to target specific hardware or environments.
Example workflow that runs on the self‑hosted runner using the custom label prod-ubuntu:
prod-linux) will pick up matching jobs. The runner process will show job lifecycle messages:

Quick reference
Note: Wrap any tokens or placeholders like
<RUNNER_TOKEN> in backticks when copying commands.
Summary
- Use runner groups to control which repositories and workflows can access self‑hosted runners.
- Install and register a self‑hosted runner on a VM using the official runner package and a short‑lived registration token.
- Use labels (default and custom) in your workflow
runs-onto target specific runners. - Never enable self‑hosted runners for public repositories without a clear mitigation strategy.