Filtering GitHub Notifications in GmailWed, Nov 4, 2020
GitHub sends notifications about everything. This is great, but also noisy. The good news is we can wrangle it with a few filters. The filters below are geared for Gmail and make use of Gmail’s Important feature, where important mail is flagged and grouped separately when Gmail is configured with the
Priority Inbox inbox type.
Notifications that are important to us, such as review requests, mentions, and comments on issues we are involved in, will be flagged as important. Notifications that are the result of us being subscribed to a repository will still end up in the inbox but not marked important. Notifications like commits on pull requests will skip the inbox entirely but won’t be marked as read so that the next time a comment is posted to that pull request we’ll see all the pushes unfurled in the thread.
The filters use a set of
CC email addresses that GitHub defines here.
Matches: from:(firstname.lastname@example.org) Do this: Apply label "GitHub"
Matches: (cc:email@example.com OR cc:firstname.lastname@example.org OR cc:email@example.com OR cc:firstname.lastname@example.org OR cc:email@example.com OR cc:firstname.lastname@example.org OR cc:email@example.com) Do this: Mark it as important
Matches: cc:firstname.lastname@example.org "requested your review" Do this: Apply label "RR/Me", Mark it as important
Matches: cc:email@example.com "requested review from" Do this: Apply label "RR/Team", Mark it as important
Matches: cc:firstname.lastname@example.org Do this: Never mark it as important
Matches: cc:email@example.com Do this: Skip Inbox, Never mark it as important
GitHub also has an optional feature that makes this even better. We can configure GitHub to send notification emails for our own activity. If we enable this feature we get a complete history of issues and pull requests in our email client. The following filter marks our activity notifications as read and archived so that we don’t see them in our inbox and only when viewing threads. It also marks the notification as important so that the thread as a whole is marked as important.
Matches: cc:firstname.lastname@example.org Do this: Skip Inbox, Mark as read, Mark it as important
These notifications are enabled in GitHub’s Notification settings.
With all the above filters enabled our filter settings in Gmail should look like this: