How do you stop people merging their own PRs with admin rights?
IntermediateProductionBranch protection, rulesets, CODEOWNERS and review at scale
Answer
Enable "do not allow bypassing the above settings" and keep the bypass list empty or limited to a break-glass group. Require approval from someone other than the last pusher. Admin ability to bypass is a policy decision; making it explicit and audited is what satisfies auditors.
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