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 CODEOWNERS on the branch first: a team of the old organization shows as an unknown owner.
gh api "repos/OWNER/REPO/codeowners/errors?ref=BRANCH"

On the blog

History

  • 14 Nov 2026 Added as Using.