How do you audit who can push or merge across an organisation?
IntermediateProductionBranch protection, rulesets, CODEOWNERS and review at scale
Answer
Review org roles and team permissions through the API, list rulesets and bypass actors, and stream the audit log to a SIEM. Run periodic checks for repos with no protection, admins with direct push, and outside collaborators.
gh api orgs/ORG/rulesets
gh api repos/ORG/REPO/collaborators --jq '.[] | {login, role_name}'
More on Branch protection, rulesets, CODEOWNERS and review at scale
What branch protection settings do you enable on `main` by default?BeginnerWhy do rulesets win over classic branch protection for an organisation?IntermediateHow do you roll out a new org-wide ruleset without breaking 300 repos?AdvancedHow do you protect release tags from being moved or deleted?IntermediateHow do you structure CODEOWNERS for a large org?IntermediateCODEOWNERS says three teams own a path but PRs stall waiting for any one of them. How do you fix it?Advanced