DevOps / Github Interview questions
How does GitHub enforce required reviewers with CODEOWNERS?
A CODEOWNERS file, placed in the repository root, .github/, or docs/, maps file paths or patterns to specific users or teams who must review any pull request touching those paths. A line like /infra/ @platform-team means any PR modifying files under /infra/ automatically requests review from the platform team and, when the branch protection setting "Require review from Code Owners" is enabled, cannot merge without their approval.
This works together with branch protection rules: requiring Code Owner review on a protected branch means sensitive paths, like infrastructure config or security-critical modules, can't be changed without sign-off from the specific people responsible for them, regardless of whether the PR author already has general write access to the whole repository.
More Related questions...