Using
GitHub Enterprise governance
Last reviewed
A GitHub organization with managed users stays closed by a few rules, not by its settings page. Private repos, flat teams fed by the identity provider, one ruleset for every repo.
The rules
| Rule | Why |
|---|---|
| Private repos, not internal | Every enterprise member can read an internal repo, also in organizations they aren't in |
| Flat teams, one identity provider group per right | A linked team can't be nested, links to one group and holds no manual members |
Name a team after the right it gives: <area>-admin, -write, -read |
A job title is a second word everyone has to translate into the right |
| The privileged right in a just-in-time group, plus one permanent group for everyone | A user in no linked team leaves the organization, so someone whose only group is eligible drops out when the activation ends |
| One organization ruleset, with only rules every repo can meet | A required check a repo can't produce blocks all its merges |
With Entra, that is PIM for Groups; Microsoft recommends the same pair. Licences: a managed user in no organization uses none, the first membership does, also through a linked team.
One ruleset for the organization
- Only organization owners edit it. Repo admins add rulesets on top, and the most restrictive rule applies: the same move as Azure Policy at the management group.
- Bypass: the repository admin role, for pull requests only.
Before a repo moves in
- Save every ruleset as JSON and put it back with the new team IDs. Bypass actors and required reviewers hold team IDs, and an ID belongs to one organization.
- Check
CODEOWNERSon the branch first: a team of the old organization shows as an unknown owner.
gh api "repos/OWNER/REPO/codeowners/errors?ref=BRANCH"
- App installations stay behind, and the owner is part of the GitHub Actions OIDC subject, so cloud federation rules need the new name.
Links
- About internal repositories — Who can read an internal repo.
- Teams and identity provider groups — The rules for linking a team to a group.
- Deprovisioning and reinstating users — When a managed user is removed from an organization.
- PIM for Groups — Eligible groups, and how they work with app provisioning.
- People who don't consume licences — When a managed user uses a licence.
- About rulesets — Rule layering: the most restrictive rule applies.
- Creating rulesets for an organization — Targets and bypass permissions.
- About code owners — Which teams can own code.
- REST API for rules — Rulesets as JSON, with their actor and reviewer IDs.
On the blog
- Set up a GitHub repo where a coding agent can't merge without you · 11 Oct 2026
- Hand GitHub issues to Claude with no API key and a US$20 cap · 20 Oct 2026
History
- 14 Nov 2026 Added as Using.