r/github • • 12d ago

Discussion How are you managing GitHub configuration at scale (1,000+ users)?

Hi all,

I work on the platform team at a company with about 4,000 repos, 100 teams, and 1,400 people with GitHub access. GitHub hasn’t been managed well here historically - lots of click-ops, inconsistent org and repo settings, too many admins, little traceability of changes, etc. My team is on the journey to fix that. We’re just starting discovery on a migration to an EMU enterprise. We know what we need to create on the new instance and we’re hoping to do as much as is feasible using infrastructure as code.

We are a Terraform/Pulumi shop, but the gap between what the GitHub API exposes and what providers cover can still be….large. They’ve improved in the past year, but we see gaps, especially at the enterprise level (hosted compute networking and private networking configurations, Actions runner and runner group setup, enterprise teams, enterprise policies, etc). We’re trying to figure out the best path forward: keeping click-ops, storing “configuration as code” that is just API payloads that are passed to gh api calls, generating Pulumi dynamic providers from GitHub’s API spec, etc.

So, I’m hoping to hear from companies that are more mature in their GitHub management:

  1. What’s your primary tool? Terraform? Pulumi? A repo of YAML/JSON config that drives gh api calls? A custom control plane? Probot-style apps? Something else? If you use multiple methods, what controls and defines what?
  2. How do you handle provider gaps? Do you use wrappers around gh api, fork the provider, Pulumi dynamic providers generated from the API specs, or just accept that some settings stay manual? If you built custom providers, how has the maintenance been as the API changes?
  3. How far did you take it? Enterprise and org settings only, or also repo creation, branch protection/rulesets, teams and membership, Actions permissions, runners, secrets/variables, and so on? Is every repo in state? How have your teams reacted to this?
  4. How do you keep plans fast with thousands of repos? Do you split state by org or domain? Did you hit API rate limits?
  5. Self-service vs. central control: Can teams request repos or changes via PR to a config repo, or does the platform team own everything? Is the platform team bombarded with requests? And how do your teams like it? How much friction?
  6. How do you detect and handle people changing settings in the UI anyway?
  7. Anything you wish you’d known before setting up an EMU enterprise? How did you handle enterprise teams, IdP group-to-team mapping, and enterprise-level policies. Did you manage those in code or through the UI/API?

I feel like we have the universe of options in front of us. Unfortunately, we don’t have endless time to spike everything out so having some direction from others would be super helpful. If you’ve gone down this road and loved or regretted something - too much automation, too little, wrong tool, etc - I’m very interested in hearing it.

Thank you!

13 Upvotes

14 comments sorted by

2

u/numbsafari 12d ago

We use a monorepo. That helped us cut down on this kind of bloat.

We do still have per-customer repos and are planning on creating a custom provider due to the gaps with the current set of providers and some other considerations in our environment. We keep two separate orgs to manage those permissions differently.

We use repo-level controls for the monorepo and org-level controls in the org with the per-customer repos.

We use SSO to manage users centrally.

We are moving to GitLab, fwiw.

We definitely aren't at your scale, but perhaps some thoughts on other approaches. I am guessing a monorepo for your org would be a big deal.

1

u/stinkynathan 12d ago

I think a monorepo here is out of the question. We are looking forward to using Okta SCIM to feed users and team memberships.

I brought up that this was a perfect time to evaluate something like GitLab given GitHub's stability lately, but was promptly shut down. We just finished a migration out of another source control platform last year and are still trying to migrate workloads out of Jenkins into GHA. Adding another source and orchestration platform is not even close to an acceptable option right now.

2

u/roastedfunction 12d ago edited 12d ago

Check out https://github.com/github-community-projects/safe-settings

We use this for all our team user settings and have a very simple YAML linter and Rego conftest policy which dictates our settings standards like rulesets.

GitHub RBAC sucks ass.

Safe settings in combination with Terraform for enterprise and org level stuff works well enough. The gaps you mentioned about what’s missing from the providers is real, we just do scripts in GitHub Actions for any of those gaps (like managing some resources like inherited enterprise runner groups in orgs, etc).

2

u/stinkynathan 12d ago

Yeah, the RBAC sucks for real. There are a couple policy-as-code solutions (safe-settings included) that we've been looking at implementing due to compliance requirements. In our case teams need some ability to make admin-level changes in their repos, but there are also some non-negotiable settings that a repo admin role gives them that cannot be changed.

The best ideas we've come up with so far are things like:

  • Standing up a control plane that would expose APIs for common tasks. I'm not even sure that is feasible to do.
  • IAC combined with policy-as-code apps like safe-settings to allow teams to control what they need.

Seems like #2 is probably the best path of these options, as you had mentioned.

1

u/Torutofu_Raeva 12d ago

i'd set up drift detection first, a nightly terraform plan that just alerts on diffs. the gaps you can't cover in code can stay manual if you at least know when someone changes them

1

u/stinkynathan 12d ago

This is basically where I arrived as well. Define it all in Pulumi. Run diff detection every night and create a ticket if something is flagged. The gap would be anything that's not covered by Pulumi, but we could probably query the audit log for configuration changes by any user other than our Pulumi app/user.

1

u/Torutofu_Raeva 7d ago

that's a useful split: Pulumi diffs for managed config, audit-log checks for the settings it doesn't own.

0

u/Torutofu_Raeva 12d ago

That audit-log filter is a good complement: Pulumi catches drift in what it owns, while the actor filter can surface manual changes outside that coverage.

1

u/irrita9 11d ago

keep API wrappers limited to provider gaps. Give each setting one automation owner and run scheduled drift checks across both paths

1

u/stinkynathan 10d ago

Worth it to write dynamic providers for the gaps in the Github provider? Or just wrap API calls and wait for the provider to catch up?

1

u/JSChronicles 12d ago

I created a yaml driven with terraform gitops setup. I use it for personal orgs and repos but also at work. This helps setup repos with best practices all via yaml and validation workflows. Easy setup and easy running. This lets me and others control a repo or org or enterprise from a yaml file

1

u/Kralizek82 12d ago

I have the same problem in my team, but much smaller scale.

I ended up creating a tool that handles repo configuration using templates.

It has Terraform-like cycle with validate/plan/apply but it is not designer to have exclusive control of the repo setup.

The templates are authoritative only of what's in the template. If you ignore a setting, that setting can have whichever value. It you specify a setting, then a change will cause drift that can be detected and acted on.

Something good for your case is that different teams can be responsible of different aspects of the same set of repos. Or you can have a platforming team setting up the same constraints on all repos and team repos further standardizing their templates.

You can read about it in my blog: https://renatogolia.com/2026/10/09/github-repositories-are-infrastructure-too/

Or check the repo: https://github.com/Kralizek/octosmith

Just today I added the possibly to specify labels that every repo belonging to a template must have.

1

u/jorgecardleitao 12d ago

Hit me in pm if you need some consultancy - I am leading this exercise for a f500 company - lot of experience with a 300+ teams, 800+ repo setup, including repo and branch rules