About runner groups
To control access to runners at the organization level, organizations using the GitHub Team plan can use runner groups. Runner groups are used to collect sets of runners and create a security boundary around them.
When you grant access to a runner group, you can see the runner group listed in the organization's runner settings. Optionally, you can assign additional granular repository access policies to the runner group.
When new runners are created, they are automatically assigned to the default group unless otherwise specified. Runners can only be in one group at a time. You can move runners from one runner group to another. For more information, see "Moving a runner to a group."
For information on how to route jobs to runners in a specific group, see "Choosing the runner for a job."
Creating a self-hosted runner group for an organization
Warning: We recommend that you only use self-hosted runners with private repositories. This is because forks of your public repository can potentially run dangerous code on your self-hosted runner machine by creating a pull request that executes the code in a workflow.
For more information, see "About self-hosted runners."
Note: When creating a runner group, you must choose a policy that defines which repositories have access to the runner group. To change which repositories and workflows can access the runner group, organization owners can set a policy for the organization. For more information, see "Enforcing policies for GitHub Actions in your enterprise."
All organizations have a single default runner group. Organization owners using the GitHub Team plan can create additional organization-level runner groups.
If no group is specified during the registration process, runners are automatically added to the default group. You can later move the runner from the default group to a custom group. For more information, see "Moving a runner to a group."
For information about how to create a runner group with the REST API, see "REST API endpoints for GitHub Actions."
-
On GitHub, navigate to the main page of the organization.
-
Under your organization name, click Settings. If you cannot see the "Settings" tab, select the dropdown menu, then click Settings.
-
In the left sidebar, click Actions, then click Runner groups.
-
In the "Runner groups" section, click New runner group.
-
Enter a name for your runner group.
-
Assign a policy for repository access.
You can configure a runner group to be accessible to a specific list of repositories, or to all repositories in the organization. By default, only private repositories can access runners in a runner group, but you can override this. This setting can't be overridden if configuring an organization's runner group that was shared by an enterprise.
-
Click Create group to create the group and apply the policy.
Changing which repositories can access a runner group
Warning: We recommend that you only use self-hosted runners with private repositories. This is because forks of your public repository can potentially run dangerous code on your self-hosted runner machine by creating a pull request that executes the code in a workflow.
For more information, see "About self-hosted runners."
For runner groups in an organization, you can change what repositories in the organization can access a runner group.
-
Navigate to the main page of the organization where your runner groups are located.
-
Click Settings.
-
In the left sidebar, click Actions, then click Runner groups.
-
In the list of groups, click the runner group you'd like to configure.
-
Under "Repository access," use the dropdown menu to click Selected repositories.
- To the right of the dropdown menu, click .
- In the popup, use the checkboxes to select repositories that can access this runner group.
-
Click Save group.
Changing the name of a runner group
- Navigate to the main page of the organization where your runner groups are located.
- Click Settings.
- In the left sidebar, click Actions, then click Runner groups.
- In the list of groups, click the runner group you'd like to configure.
- Enter the new runner group name in the text field under "Group name."
- Click Save.
Automatically adding a self-hosted runner to a group
You can use the configuration script to automatically add a new runner to a group. For example, this command registers a new runner and uses the --runnergroup
parameter to add it to a group named rg-runnergroup
.
./config.sh --url $org_or_enterprise_url --token $token --runnergroup rg-runnergroup
The command will fail if the runner group doesn't exist:
Could not find any self-hosted runner group named "rg-runnergroup".
Moving a self-hosted runner to a group
If you don't specify a runner group during the registration process, your new runners are automatically assigned to the default group, and can then be moved to another group.
-
On GitHub, navigate to the main page of the organization.
-
Under your organization name, click Settings. If you cannot see the "Settings" tab, select the dropdown menu, then click Settings.
-
In the left sidebar, click Actions, then click Runners.
-
In the "Runners" list, click the runner that you want to configure.
-
Select the Runner group drop-down.
-
In "Move runner to group", choose a destination group for the runner.
Removing a self-hosted runner group
In order to remove a runner group, you must first move or remove all of the runners from the group.
- Navigate to the main page of the organization where your runner groups are located.
- Click Settings.
- In the left sidebar, click Actions, then click Runner groups.
- In the list of groups, to the right of the group you want to delete, click .
- To remove the group, click Remove group.
- Review the confirmation prompts, and click Remove this runner group.