Interview Prep/Git & GitHub/Branch protection, rulesets, CODEOWNERS and review at scale

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}'
All Git & GitHub questions Roadmap: Git & GitHub

More on Branch protection, rulesets, CODEOWNERS and review at scale