Reduce GitHub notifications with repository team options

Let’s configure a GitHub repository and its corresponding team to receive only the notifications that might interest us.

Mattia Roccoberton
Telepass Digital
3 min readDec 1, 2023

--

If you work in a team and you are using GitHub for your organization setting up a GitHub Team can bring some benefits.

When I started to work in our company I noticed a good amount of GitHub notifications related to some projects where I wasn’t directly involved.

Some developers using the same tech stack were associated randomly by Dependabot to the pull requests of many different projects. Another point that I noticed was that when a PR was ready for review I had to manually choose the same people every time.

Let’s see how GitHub Teams can help in this situation.

Why should I care about GitHub teams?

When a GitHub team is properly configured in a project the reviewers association to the pull requests gets easier: you can just type the team name in the reviewers selector and the right members are automatically added.

Reviewers can even be automatically assigned to a pull request when it is marked as Ready for review. GitHub notifications related to unwanted/unrelated projects can be filtered out.

Plus, when a new colleague is added to your team or removed it’s just a matter of updating the team members list and the access to the projects is updated automatically.

Team setup

First you need to create the GitHub team:

  1. Open the GitHub Organization page (ex. https://github.com/the-organization-name);
  2. Click on the “Teams” link in the top navbar;
  3. Click on the “New team” button above the teams’ list;
  4. Fill the “Create new team” form and proceed with “Create team” button.

If you want the automatic assignment of reviewers to the pull requests:

  1. Open again the “Teams” link;
  2. Click on your team name;
  3. Click on the “Settings” link in the top navbar;
  4. Click on “Code review” link in the sidebar;
  5. Set the option “Enable auto assignment” (optionally change the number of members to assign) and proceed with “Save changes” button.

Repository setup

Now you can update the team repository settings:

  1. Open a repository of your organization (ex. https://github.com/the-organization-name/my-project);
  2. Click on the “Settings” link in the top navbar;
  3. Click on the “Collaborators and teams” link in the sidebar and then on “Add teams” button;
  4. Lookup your team name, choose a role (es. Maintain) and then the submit button.

Optionally setup the code owners of the repository: create (if it doesn’t exit) or update the file .github/CODEOWNERS with the following content:

* @the-organization-name/my-team

The * is a file mask to include every file of the project but it can be customized using specific paths and assigning different Teams or Members to specific area of your code.

Code owners are automatically requested for review when a pull request is going to update a file that they own and a review from the owners can be enforced:

  1. Click on the “Settings” link in the top navbar;
  2. Click on the “Branches” link in the sidebar and then on a specific branch name (ex. “main”);
  3. You can optionally enable “Require review from Code Owners”.

All the GitHub documentation about code owners is available here.

Dependabot team configuration

If you are using Dependabot it can be easily configured in a repository to ask for reviewers only from Team members.

Update the .github/dependabot.yml updating the “reviewers” section, for example:

reviewers:
- "the-organization-name/my-team"

Conclusion

We saw how GitHub Teams, when properly configured, can help quite a lot to control the notifications to right members of a company, simplify the reviewers assignment and improve the team organization.

For more information about GitHub teams please refer to the documentation page.

This article was written by Mattia Roccoberton, Ruby backend developer, and edited by Marta Milasi and Gaetano Matonti, respectively UX Content Lead and Managerial Software Engineer at Telepass. Interested in joining our team? Check out our open roles!

--

--