Team review requests on GitHub
Request reviews from a GitHub team, route them to individuals automatically, and use CODEOWNERS so the right people review each area.
On this page
On GitHub you can request a review from a whole team, such as @yourorg/backend, instead of a specific person. Teams can route those requests to individual members automatically, and a CODEOWNERS file can request the right team for each part of the codebase without anyone remembering. Together, they spread reviews fairly and make sure sensitive areas always get the right eyes.
Requesting a team
On a pull request, add a team under reviewers just as you'd add a person. Everyone on the team can see the request, and it appears in their review queues. Teams belong to organisations, so this works in organisation repositories.
Routing to individuals
Leaving a request with a whole team often means everyone assumes someone else will take it. GitHub's code review assignment settings for a team can automatically assign one or more members when the team is requested, using approaches such as rotating through members or balancing load. Team maintainers configure this in the team's settings. GitHub's documentation on code review assignment covers the options.
CODEOWNERS: the right reviewers for each area
A CODEOWNERS file lists who owns which paths. When a pull request changes those files, GitHub requests reviews from the owners automatically.
- Create a file named
CODEOWNERSin the repository's.github/folder (or the root, ordocs/). - Add lines with a path pattern and owners:
# Everything in the payments folder
/payments/ @yourorg/payments-team
# All Terraform files
*.tf @yourorg/infrastructure
- Merge it to the default branch.
Patterns work like .gitignore, and later lines take precedence over earlier ones. Owners can be people or teams, and need write access to the repository.
Combined with the branch protection rule to require review from code owners, CODEOWNERS makes owner approval mandatory for those paths. See required reviews and branch protection.
Habits that keep team reviews moving
- Keep teams small and focused, so a request reaches people who know the code.
- Use automatic assignment, so every team request has a named reviewer.
- Review CODEOWNERS occasionally, removing people who've moved on.
- Don't over-own. If one team owns everything, it becomes a bottleneck. Own the sensitive areas; leave the rest to normal review.
- Agree a turnaround, such as a first response within one working day.
An example setup
A product team has three groups: web, API and infrastructure. They create a GitHub team for each, turn on automatic review assignment so each team request goes to one member in rotation, and add a CODEOWNERS file mapping /web/ to the web team, /api/ to the API team and *.tf to infrastructure. They require one approval for most changes, plus code owner approval. Now a pull request touching both web and API code automatically gets one reviewer from each team, and nobody has to remember who owns what.
Where team requests show up for you
GitHub's review-requested:@me search includes requests made to teams you're on, while user-review-requested:@me narrows it to requests made to you personally, where supported. OneNotch's To review tab lists open pull requests requesting your review as GitHub reports them for your account, with check summaries and approvals, so team requests routed to you appear in the notch alongside personal ones. See how to see pull requests waiting for your review.
Drafts don't trigger code owner requests until they're marked ready. See draft pull requests.
FAQs
Where does the CODEOWNERS file go?
In .github/, the repository root, or docs/. GitHub uses the first one it finds in that order.
Does a team request count as a required approval?
An approving review from a team member counts toward required approvals. Code owner rules require an approval from an owner of the changed files.
Can CODEOWNERS request individuals instead of teams?
Yes. Owners can be users or teams.
Why wasn't the code owner requested?
The pull request may be a draft, the file pattern may not match, or the owner may lack write access.