Skip to content

Instantly share code, notes, and snippets.

@aripollak
Last active February 6, 2024 21:42
Show Gist options
  • Save aripollak/5203dfe2210a7abca5570924ea501a7b to your computer and use it in GitHub Desktop.
Save aripollak/5203dfe2210a7abca5570924ea501a7b to your computer and use it in GitHub Desktop.
How to filter github email notifications

This is based on @brendar's instructions, which is based on email addresses from https://help.github.com/en/articles/about-email-notifications. It creates two labels:

  • GitHub
  • GitHub - Important

Importing the filters

Save the attached mailFilters.xml file locally, then in Gmail, go to Settings -> Filters and Blocked Addresses, then click on Import Filters, browse to the attached .xml file and click Open file. Then click the Create filters button if they look good.

Creating the filters manually

  1. Filter all GitHub notifications out of the inbox and apply the GitHub label
Matches: from:([email protected])
Do this: Skip Inbox, Apply label "GitHub"
  1. Apply the GitHub - Important label to GitHub notifications that are not going to [email protected] or [email protected]
Matches: from:([email protected]) to:([email protected], [email protected])
Do this: Apply label "GitHub - Important"
  1. Apply the GitHub - Important label to GitHub notifications with the text "requested your review" to flag notifications about reviews for which you were explicitly requested (as opposed to review requests going to a team you're in)
Matches: from:([email protected]) "requested your review"
Do this: Apply label "GitHub - Important"
<?xml version='1.0' encoding='UTF-8'?>
<feed xmlns='http://www.w3.org/2005/Atom' xmlns:apps='http://schemas.google.com/apps/2006'>
<title>Mail Filters</title>
<id>tag:mail.google.com,2008:filters:z0000001657051866471*0504958098078338819,z0000001657051940497*3614399282889166443,z0000001657052003382*5360556191251113116</id>
<updated>2024-02-06T21:31:01Z</updated>
<author>
<name>Ari Pollak</name>
</author>
<entry>
<category term='filter'></category>
<title>Mail Filter</title>
<id>tag:mail.google.com,2008:filter:z0000001657051866471*0504958098078338819</id>
<updated>2024-02-06T21:31:01Z</updated>
<content></content>
<apps:property name='from' value='[email protected]'/>
<apps:property name='to' value='[email protected], [email protected]'/>
<apps:property name='label' value='GitHub important'/>
<apps:property name='sizeOperator' value='s_sl'/>
<apps:property name='sizeUnit' value='s_smb'/>
</entry>
<entry>
<category term='filter'></category>
<title>Mail Filter</title>
<id>tag:mail.google.com,2008:filter:z0000001657051940497*3614399282889166443</id>
<updated>2024-02-06T21:31:01Z</updated>
<content></content>
<apps:property name='from' value='[email protected]'/>
<apps:property name='hasTheWord' value='&quot;requested your review&quot;'/>
<apps:property name='label' value='GitHub important'/>
<apps:property name='sizeOperator' value='s_sl'/>
<apps:property name='sizeUnit' value='s_smb'/>
</entry>
<entry>
<category term='filter'></category>
<title>Mail Filter</title>
<id>tag:mail.google.com,2008:filter:z0000001657052003382*5360556191251113116</id>
<updated>2024-02-06T21:31:01Z</updated>
<content></content>
<apps:property name='from' value='[email protected]'/>
<apps:property name='label' value='GitHub'/>
<apps:property name='shouldArchive' value='true'/>
<apps:property name='sizeOperator' value='s_sl'/>
<apps:property name='sizeUnit' value='s_smb'/>
</entry>
</feed>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment