Attribute Github PR automatically

If you are bored to attribute every project pull request one by one and always to the same persons, you can configure github to do it for you.

Managing auto-assignment to your team

These settings will define the rules to assign pull request to people of a team. If you want to restrict to some people of an existing team, the easiest way is to create a dedicated team of reviewer.

Follow the step in doc access and configure it : https://docs.github.com/en/organizations/organizing-members-into-teams/managing-code-review-settings-for-your-team

For one of my team, we are 3, then I managed the settings as follow

Manage codeowners

Then, you need to configure the codeowners of your repository. Set .github/CODEOWNERS file. Simple exemple :

* @org/team

* is a regex, the rule will be applied for all PR

@org/team is the team which PR will be assigned

To go further : https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/about-code-owners

Note that this configuration file should be set to target branch to be effective.

Leave a Reply

Your email address will not be published. Required fields are marked *