Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Require Github PR approvals from multiple groups

I'm using the codeowners file to require PR approvals before they can be merged. What I'd like to do is:

  1. Require all PRs to have at least one approval from a group of code owners (engineers)
  2. Require all PRs to have at least one approval from a group of QA

It seems like the code owners file does a hierarchical thing where only one group owns the code and you can create rules for certain directories but those will just override the default code owner.

My current .github/CODEOWNERS file looks like this:

* @my-org/engineer-code-owners

Is there a way to require at least one approval from two different groups?

like image 947
Brady Dowling Avatar asked Sep 05 '25 01:09

Brady Dowling


2 Answers

You can list multiple users/groups on a single line (separated by a single space) to request multiple reviews.

* @my-org/engineer-code-owners @my-org/qa-code-owners

As of time of writing, there’s no way to require a review from all code owners assigned to a pull request.

Is there any way to require all of the listed people to approve?

No, there currently isn’t a way to do that built-in to the CODEOWNERS feature.

See CODEOWNERS reference and thread on required reviews.

like image 85
superhawk610 Avatar answered Sep 07 '25 17:09

superhawk610


On one line of CODEOWNERS, you can request reviews from multiple reviewers but you can't require approvals.

In the repo settings, branch protection, you can require a certain number of approvals but you can't specify who.

I was really hoping I could stop myself merging without QA approval!

like image 40
Denis Howe Avatar answered Sep 07 '25 18:09

Denis Howe