Determining who should review files for code review is not always clear, which is why GitHub is introducing code owners, a new feature that automatically requests reviews from the code owners when a pull request changes any owned files.
This feature lets repository maintainers define the exact people and teams who need to review projects, according to GitHub.
Code owners work by creating a file named CODEOWNERS in the repository’s root directory (or in .github/ if you prefer) with the following format:
Once that is complete, code owners will automatically be requested for review whenever pull request touches the files they own. For extra security, GitHub has also added a new protected branch option to make sure the right people get to review. If a user enables protected branches, a code owner for each owned file has to leave a review before someone can merge a pull request to that protected branch, said GitHub.