17

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?

Brady Dowling
  • 4,920
  • 3
  • 32
  • 62

2 Answers2

7

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.

superhawk610
  • 2,457
  • 2
  • 18
  • 27
4

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!

Denis Howe
  • 2,092
  • 1
  • 23
  • 25