Runner Groups Configuration

Earn 25 points (50 with Pro) in two steps

  1. ① Read through the lesson — each section gets a ✓ as you scroll through it.
  2. ② When every section has a ✓, tap Complete lesson.

0 of 11 read · keep scrolling

✦ See fewer ads and earn double points — 50 a lesson instead of 25 — with Pro

Module: Manage GitHub Actions

Section: Manage Runners

Lesson Title: Runner Groups Configuration


Introduction: Why Runner Groups Matter

In the world of continuous integration and continuous deployment (CI/CD), GitHub Actions has become the standard for automating software workflows. While many teams start by using GitHub-hosted runners—the virtual machines managed by GitHub—the need for scale, security, and specialized hardware often drives organizations to adopt self-hosted runners. When you move to self-hosted infrastructure, you are no longer just managing a single machine; you are managing a fleet. This is where "Runner Groups" come into play.

Runner groups are a management construct within GitHub Enterprise and GitHub Organizations that allow you to organize your self-hosted runners into logical buckets. Without runner groups, every self-hosted runner you add would be available to every repository in your organization. This "flat" architecture is dangerous for security, inefficient for resource allocation, and impossible to manage at scale. By grouping runners, you gain the ability to apply access controls, set concurrency limits, and ensure that sensitive workloads only run on specific, hardened infrastructure.

Understanding runner groups is critical for any DevOps engineer or platform team lead. If you manage an organization with multiple teams, you cannot allow a junior developer's experiment in a sandbox repository to accidentally consume the entire compute budget of your production deployment runners. Runner groups provide the granular control necessary to treat your CI/CD infrastructure as a first-class citizen of your software development lifecycle.


Not read yet

The Fundamentals of Runner Groups

At its core, a runner group is a policy-based container for your self-hosted runners. When you create a runner group, you define two primary things: who can access the runners inside that group, and what those runners are allowed to do.

When you register a self-hosted runner, it is assigned to the "Default" group unless you specify otherwise. If you have a large organization, you will quickly find that the Default group becomes cluttered, making it difficult to manage security policies. By creating custom groups, you can segregate runners based on environment (e.g., Development, Staging, Production), hardware capability (e.g., GPU-enabled, high-memory), or compliance requirements (e.g., PCI-DSS compliant machines).

Key Capabilities of Runner Groups

  • Access Control: You can restrict which repositories or organizations are allowed to trigger jobs on a specific runner group. This prevents unauthorized teams from using your private or expensive compute resources.
  • Concurrency Limits: You can set a maximum number of concurrent jobs that a group can handle. This acts as a circuit breaker, preventing your CI system from overwhelming your underlying infrastructure during a spike in pull requests.
  • Policy Enforcement: You can enforce requirements, such as requiring workflows to be from specific repository branches, which adds an extra layer of defense against malicious actors trying to execute code on your internal network.
  • Organizational Hierarchy: Runner groups can be created at the enterprise level or the organization level, allowing for a delegated management model where central IT manages the infrastructure, but individual teams manage their own runner groups.

Callout: Runner Groups vs. Labels It is common to confuse runner groups with labels. Think of runner groups as the "Who" and "Where"—they define access and organizational boundaries. Think of labels as the "What"—they define the technical capabilities of the machine (e.g., ubuntu-latest, gpu-enabled, docker-capable). You use groups to restrict access, and you use labels to route specific jobs to specific machines within those groups.


Not read yet

Configuring Runner Groups: A Step-by-Step Guide

Configuring runner groups requires administrative access to the GitHub organization or enterprise account. If you do not have these permissions, you will need to coordinate with your organization's owner.

Step 1: Navigating to the Settings

  1. Log in to GitHub and navigate to your organization's main page.
  2. Click on the Settings tab located in the top navigation bar.
  3. In the left-hand sidebar, look for the Actions section and click on Runners.
  4. You will see a list of existing runners and a sub-tab labeled Runner groups. Click on this tab.

Step 2: Creating a New Group

  1. Click the New runner group button.
  2. Provide a descriptive name for the group. Use a naming convention that reflects the purpose of the group, such as prod-high-performance or team-alpha-sandbox.
  3. Choose the Access policy. You can choose to allow "All repositories" (not recommended for production) or "Selected repositories."
  4. If you chose "Selected repositories," use the search bar to add the specific repositories that should have access to this group.
  5. Click Create group.

Step 3: Assigning Runners to the Group

Once the group is created, you need to populate it. You can move existing runners into the group or assign new runners during the registration process.

  1. To move an existing runner, go to the Runners sub-tab.
  2. Click on the name of the runner you wish to move.
  3. In the runner details, look for the Runner group dropdown and select your newly created group.
  4. Click Save.

Note: Moving a runner to a new group will immediately change the access permissions for that runner. If the runner was previously accessible to all repositories, and you move it to a group that only allows access to one repository, any other workflows currently using that runner will fail immediately.


Not read yet

Advanced Configuration: Concurrency and Security Policies

Once your groups are set up, you should focus on tuning them for reliability. The most important setting here is the concurrency limit.

Managing Concurrency Limits

If you have a self-hosted runner group running on a set of virtual machines with limited CPU and RAM, you don't want 50 concurrent jobs trying to compile code at the same time. This would lead to resource contention, slow builds, and potentially crashing the runner service.

In the runner group configuration page, you will find an option for Runner group concurrency. By default, this is set to unlimited. You should change this to a value that matches the capacity of your infrastructure. If you have five machines in the group, and each machine can comfortably handle two jobs, set the limit to 10.

Enforcing Security Policies

GitHub allows you to restrict which workflows can run on a runner group based on the workflow's source. This is a vital security feature. You can toggle the setting: "Allow workflows from internal or private repositories only." This prevents public repositories from accidentally triggering jobs on your private infrastructure, which is a major security risk if your runners have access to internal databases or secrets.


Not read yet

Practical Examples and Use Cases

Let's look at a few real-world scenarios where runner groups are essential.

Scenario 1: The Multi-Team Organization

Imagine you have an organization with a "Frontend" team and a "Backend" team. The Frontend team needs specialized runners with Node.js and browser-testing capabilities, while the Backend team needs runners with high-memory machines for running integration tests against a database.

  • Group A (Frontend): Contains 5 runners, restricted to the frontend-app repository.
  • Group B (Backend): Contains 5 runners, restricted to the backend-api repository.
  • The Result: The teams don't compete for resources. If the Frontend team starts a massive build that consumes all their runners, the Backend team's CI/CD pipeline remains unaffected.

Scenario 2: Production vs. Sandbox

You want to ensure that your production deployment pipeline is never blocked by a developer running a test workflow in a sandbox repository.

  1. Production Group: This group contains only the most stable, well-maintained runners. Access is restricted to the production and main branches of your primary application repository.
  2. Sandbox Group: This group contains "disposable" runners. Any repository in the organization can use these. If these runners crash or get bogged down, it has zero impact on the production deployment process.

Not read yet

Comparison Table: GitHub-Hosted vs. Self-Hosted Runner Groups

Feature GitHub-Hosted Runners Self-Hosted Runner Groups
Maintenance None (Managed by GitHub) High (Requires OS/Patch management)
Cost Per-minute usage billing Cost of underlying compute (AWS/GCP/On-prem)
Access Control Global Granular (Repository/Org level)
Environment Clean image every time Persistent (Can cache data/dependencies)
Network Access Public (requires VPN/IP allowlisting) Can run inside private VPC/Intranet

Best Practices for Managing Runner Groups

Managing infrastructure at scale is as much about process as it is about technology. Follow these best practices to keep your runner fleet healthy.

1. Naming Conventions

Use a consistent naming scheme for your groups. A good format is [Env]-[Team]-[Capability]. For example, prod-data-gpu or dev-platform-general. This makes it immediately obvious what the group is for when you are looking at a list of fifty different groups.

2. Infrastructure as Code (IaC)

Do not create runner groups manually through the web UI for long-term production setups. Use the GitHub API or Terraform to define your runner groups. This ensures that your configuration is version-controlled, auditable, and reproducible. If a group is accidentally deleted, you can restore it in seconds using your Terraform state.

3. Monitoring and Alerting

Runner groups are a black box if you aren't monitoring them. Ensure you have logs streaming from your runners to a centralized logging system (like ELK, Datadog, or CloudWatch). Set up alerts for when the number of idle runners in a group drops to zero, or when the job queue depth for a specific group exceeds a certain threshold.

4. The "Default" Group Trap

Never put production runners in the "Default" runner group. The Default group is often the path of least resistance for new repositories. If you accidentally leave a repository with default settings, it might start pulling jobs from your production runners if they are sitting in the Default group. Always move production runners to a dedicated, restricted group.

5. Regular Lifecycle Management

Self-hosted runners can accumulate "cruft"—stale cache files, temporary build artifacts, and logs. Schedule regular replacements for the machines underlying your runner groups. Using ephemeral runners (runners that destroy themselves after a single job) is the gold standard for avoiding these issues.


Not read yet

Common Pitfalls and How to Avoid Them

Pitfall 1: The "Everything Access" Mistake

Many administrators create a group and, for the sake of simplicity, grant "All repositories" access. This is a security nightmare. If a malicious actor compromises a low-security repository, they can trigger a workflow that runs on your private, high-privilege runners.

  • The Fix: Always default to "Selected repositories." Explicitly add the repositories that need access. It takes an extra minute to configure, but it prevents unauthorized access.

Pitfall 2: Over-provisioning

Companies often spin up 50 runners because they are cheap, only to find that their CI/CD jobs are waiting in line because of concurrency limits they set too low. Or, conversely, they set the limit to "unlimited" and end up with a massive AWS bill because they accidentally triggered 100 concurrent jobs.

  • The Fix: Start with a conservative concurrency limit and monitor your job wait times. Adjust the limit upwards only when you have data showing that your average queue time is increasing.

Pitfall 3: Ignoring Runner Status

Sometimes, a runner service stops responding, but the runner still appears as "Online" in the GitHub UI. This happens if the process is hung.

  • The Fix: Implement an external health check. A simple script that checks if the runner can successfully "ping" the GitHub API or execute a dummy job every few minutes can help you detect and restart dead runners automatically.

Not read yet

Troubleshooting Runner Groups

When things go wrong, the first place to look is the Actions tab in the repository that triggered the job. If the job is stuck in a "Queued" state, it almost always points to an issue with the runner group configuration.

Troubleshooting Checklist:

  1. Is the runner group accessible? Check if the repository triggering the job is actually included in the "Selected repositories" list for the group.
  2. Are the labels correct? Does the workflow file have a runs-on label that matches the labels on the runners within the group? If your runners are labeled production but your workflow asks for ubuntu-latest, it will never pick up the job.
  3. Is the concurrency limit reached? Go to the runner group settings page and check the current number of active jobs. If the limit is 5 and there are 5 jobs running, your new job will stay queued.
  4. Is the runner service running? SSH into the machine hosting the runner and check the status of the actions.runner service. Use systemctl status actions.runner on Linux to verify it is active and connected to GitHub.

Not read yet

Deep Dive: Ephemeral Runners and Groups

One of the most powerful features you can combine with runner groups is the "ephemeral" runner configuration. When you register a runner with the --ephemeral flag, the runner will automatically unregister itself from GitHub after it completes a single job.

When you use this in combination with runner groups, you ensure that every job gets a clean environment. This eliminates "poisoned" environments where a previous build left behind a configuration file or a modified environment variable that causes the next build to fail.

Example of registering an ephemeral runner in a specific group:

./config.sh --url https://github.com/my-org --token <TOKEN> \
  --runnergroup my-production-group \
  --name my-ephemeral-runner-01 \
  --ephemeral

By using this approach, your runner group becomes a "pool" of capacity rather than a list of static machines. Your autoscaling group (in AWS or Azure) can scale the number of machines in the group up or down based on the number of jobs in the queue, and the runners will automatically join the group, perform one job, and leave.


Not read yet

Comparison of Access Policies

Access Level Description Recommended Use Case
All Repositories Any repo in the org can use these runners. Public open-source projects, internal sandboxes.
Selected Repositories Only specific repos can use these runners. Production apps, sensitive security tools.
No Access The group is effectively disabled. Maintenance mode or decommissioning.

Frequently Asked Questions (FAQ)

Q: Can a runner belong to multiple groups? A: No. A single runner instance can only be assigned to one runner group at a time. If you need a runner to satisfy multiple needs, you should use labels instead of groups.

Q: What happens if I delete a runner group? A: Any runners currently in that group will be moved to the "Default" runner group. You should be careful when deleting groups, as this effectively changes the permissions of those runners to match the Default group's policy.

Q: Can I use runner groups with GitHub Actions on GitHub Enterprise Server? A: Yes, runner groups are supported in both GitHub Enterprise Cloud and GitHub Enterprise Server. The configuration steps are identical.

Q: Is there a limit to how many runner groups I can have? A: GitHub does not impose a hard limit on the number of groups, but keep in mind that excessive fragmentation makes management difficult. Aim for a logical structure that reflects your team or project boundaries.


Not read yet

Key Takeaways

  1. Strategic Organization: Use runner groups to enforce security and resource boundaries. Never rely on the "Default" group for production or sensitive workloads.
  2. Access Control: Always prefer the "Selected repositories" access policy. It is the single most effective way to prevent unauthorized use of your compute resources.
  3. Governance through IaC: Treat your runner group configuration as code. Use tools like Terraform to define your groups to ensure consistency and disaster recovery capability.
  4. Capacity Management: Use concurrency limits to prevent your CI/CD pipelines from overwhelming your infrastructure. Monitor your queue times to determine when to scale up.
  5. Ephemeral Advantage: Combine runner groups with ephemeral runners to ensure clean, consistent environments for every build, reducing "it works on my machine" issues.
  6. Monitoring is Mandatory: A runner group is a piece of infrastructure. If you don't monitor the status and load of the runners within it, you are flying blind.
  7. Naming Matters: Implement a clear, hierarchical naming convention for your groups early on. As your organization grows, this will save you countless hours of administrative confusion.

Managing runner groups is a foundational skill for scaling GitHub Actions within an enterprise. By moving away from the default, flat structure and embracing a policy-driven, segmented approach, you transform your CI/CD infrastructure from a source of potential risk into a controlled, reliable asset for your development teams. Start by auditing your existing runners today, move them into appropriate groups, and apply the access policies that best align with your security posture.

Not read yet

Each section gets a ✓ as you scroll through it. Tap the button to jump to the next one.