Default reviewers for pull requests

Phill Denness
1 min readJul 1, 2021

Github lets you assign default reviewers to repositories.

First let’s make a Github team. This should contain everyone you want to get notified when a Pull Request is created.

I’ve named mine dev-owners and added the users to the group.

Github Settings

Next give your group adequate permissions to the repository.

  1. Click Settings -> Manage access
  2. Invite teams
  3. Add dev-owners group and set permissions to write or admin

Then create a rule

  1. Click Settings -> Branches
  2. Add Rule
  3. Branch pattern: *
  4. Tick: Require pull request reviews before merging
  5. Tick: Require review from Code Owners

Repository

Finally create a file in the root of the repository named: CODEOWNERS

Add the rule followed by the team name. Note the rules are the same as .gitignore.

The following example adds dev-owners as reviewers to any file change.

* @ORG_NAME/dev-owners

Now every pull request created will automatically notify the users in dev-owners group and require at least 1 approval before merge.

--

--