Some questions about runner groups for self-hosted runners #211897
🏷️ Discussion TypeQuestion 💬 Feature/Topic AreaActions Runner Discussion DetailsWe have a server in our network, that has GitHub Self-Hosted Runner installed on it which I installed 3 years ago. It's been working fine. The server it is on has a lot of resources. We're working with another department, who is scanning some of our current repos, for security issues. They're using Claude to perform the scans. I spent the last few hours reading through a repo that Claude produced when it scanned one of our repos. Most of the issues it found were programming issues. However, one was not. It is a GitHub Workflow issue, involving GitHub Self-Hosted Runners, it said that we should implement several runner groups, which are I understand, only done with self-hosted runners. I've never heard of runner groups, until I read about them in the security report today and did some searches on runner groups. I get the feeling that they're meant to be used by assigning a runner or runner group to some branches in the repo which are protected. What I don't understand is how many runner groups are recommended to have? We have 177 repos in our GitHub organization. Several of them are monorepos. And some of those have a lot of individual applications within them. Admittedly more than half of them haven't been touched in many years, when the GitHub Administrators group, of which I am a part, migrated all our source code out of an old on-prem TFS, to GitHub, 3 years ago. And I've been archiving the older ones as I have time, since no one has touched them in years and they're no longer in production. But even so, if there's a few that should be used for each protected branch in our active repos, I foresee this getting to hundreds, perhaps even thousands, of runner groups. Is that the idea? If so, then how do we estimate how many servers we're going to need for all of these runner groups? |
Replies: 2 comments 4 replies
|
Runner groups aren't per branch, so you won't end up with hundreds of them. A group is a set of runners plus a list of which repos are allowed to use them. Each runner is in exactly one group, and every org starts with a default group that all repos can use. That's most likely what the scan flagged: with one runner in the default group, a workflow from any of your 177 repos can run on that server and see whatever is on it. The usual setup is a few groups split by how much you trust the code, for example:
Archived and inactive repos don't need access to any group. Branches come in a different way. On GitHub Enterprise Cloud you can set a group to "Selected workflows" and pin each one to a branch, like For servers, you need at least one runner per group, not one server per group. You can install more than one runner on the same server. But if the reason for the deploy group is to keep it away from code in other repos, give that runner its own machine or VM, because runners on the same host can usually reach each other's files. Docs: |
|
I wouldn't create one runner group per repository unless you actually need that level of isolation. Runner groups are most useful as security and access boundaries. A reasonable starting point might be:
Then restrict which repositories can access each group. For production deployments, I'd keep runners isolated from ordinary pull-request workloads, particularly untrusted fork contributions. Runner labels can handle differences such as OS, architecture or toolchain without requiring a new group for every variation. I'd start with the smallest number of groups that matches your trust boundaries, then add groups when there is a concrete isolation requirement. The important question is not how many repositories you have, but which workflows should be allowed to execute on which infrastructure. |
Runner groups aren't per branch, so you won't end up with hundreds of them. A group is a set of runners plus a list of which repos are allowed to use them. Each runner is in exactly one group, and every org starts with a default group that all repos can use. That's most likely what the scan flagged: with one runner in the default group, a workflow from any of your 177 repos can run on that server and see whatever is on it.
The usual setup is a few groups split by how much you trust the code, for example:
Archived and …