Skip to content

Instantly share code, notes, and snippets.

@AlarmingCow
Last active August 25, 2021 13:44
Show Gist options
  • Save AlarmingCow/ae8e5b264489ab3e21911549b8a1cb7a to your computer and use it in GitHub Desktop.
Save AlarmingCow/ae8e5b264489ab3e21911549b8a1cb7a to your computer and use it in GitHub Desktop.

Colin's Handcrafted, Artisinal Gmail Filters For Github Notifications

Philosophy

I don't want to auto-archive anything, but I want to highlight the important stuff using labels. What's important?

  1. My PRs – "Author" label
  2. My team's PRs (over other teams') – "CPLAN" label (see caveats)
  3. Bumped PRs – "❗️" label
  4. PRs that directly mention me (over mentioning a team I'm on) – "Mentioned" label
  5. PRs that I've already commented on – "Participating" label
  6. Reopened PRs – "Reopened" label

What's less important (i.e. easier to ignore)?

  1. Merged PRs – "⏎" label
  2. Closed PRs – "Closed" label
  3. PRs I've already approved – "👍" label

What's completely unimportant (i.e. just mark as read and archive it)?

  1. My own activity

Installation

  1. Download the mailFilters.xml file
  2. Modify the file if necessary (e.g. look for your team's Jira project instead of CPLAN)
  3. In Gmail, go to Settings
  4. Go to Filters and Blocked Addresses Tab
  5. Click Import Filters
  6. Import the filters!

Caveats

  • The "merged" and "closed" filters have false positives becasue they look for the words "merged" and "closed". But most of the time they're accurate.
  • These filters call out CPLAN as the team to add a label to. If you're on a different team, replace CPLAN with the Jira project key for your team.

Additional tips

  1. Enable Gmail keyboard shortcuts and press "m" to mute a thread. If there's a PR you really don't think you need to be involved in, you can mute it and reduce your notification clutter. If the PR title changes (e.g. to remove a WIP tag) the thread will be un-muted.
<?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:1506368823164,1483654313463,1483716559737,1509629548014,1506368933017,1509543652088,6834376395137621585,1494941372147,1479738427101,1484144270930,1495118272281</id>
<updated>2018-12-20T16:45:46Z</updated>
<author>
<name>Colin Cross</name>
<email>colin.cross@rallyhealth.com</email>
</author>
<entry>
<category term='filter'></category>
<title>Mail Filter</title>
<id>tag:mail.google.com,2008:filter:1479738427101</id>
<updated>2018-12-20T16:45:46Z</updated>
<content></content>
<apps:property name='from' value='notifications@github.com'/>
<apps:property name='hasTheWord' value='&quot;Merged&quot;'/>
<apps:property name='excludeChats' value='true'/>
<apps:property name='label' value='⏎'/>
<apps:property name='shouldMarkAsRead' value='true'/>
<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:1483654313463</id>
<updated>2018-12-20T16:45:46Z</updated>
<content></content>
<apps:property name='to' value='your_activity@noreply.github.com'/>
<apps:property name='label' value='Participating'/>
<apps:property name='shouldMarkAsRead' value='true'/>
<apps:property name='shouldArchive' value='true'/>
<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:1483716559737</id>
<updated>2018-12-20T16:45:46Z</updated>
<content></content>
<apps:property name='from' value='notifications@github.com'/>
<apps:property name='label' value='Github'/>
<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:1484144270930</id>
<updated>2018-12-20T16:45:46Z</updated>
<content></content>
<apps:property name='from' value='notifications@github.com'/>
<apps:property name='hasTheWord' value='&quot;Closed&quot;'/>
<apps:property name='excludeChats' value='true'/>
<apps:property name='label' value='Closed'/>
<apps:property name='shouldMarkAsRead' value='true'/>
<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:1494941372147</id>
<updated>2018-12-20T16:45:46Z</updated>
<content></content>
<apps:property name='hasTheWord' value='cc:mention@noreply.github.com'/>
<apps:property name='label' value='Mentioned'/>
<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:1495118272281</id>
<updated>2018-12-20T16:45:46Z</updated>
<content></content>
<apps:property name='from' value='notifications@github.com'/>
<apps:property name='hasTheWord' value='bump'/>
<apps:property name='label' value='❗️'/>
<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:1506368823164</id>
<updated>2018-12-20T16:45:46Z</updated>
<content></content>
<apps:property name='hasTheWord' value='cc:author@noreply.github.com'/>
<apps:property name='label' value='Author'/>
<apps:property name='shouldAlwaysMarkAsImportant' value='true'/>
<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:1506368933017</id>
<updated>2018-12-20T16:45:46Z</updated>
<content></content>
<apps:property name='hasTheWord' value='-cc:author@noreply.github.com -cc:mention@noreply.github.com'/>
<apps:property name='shouldNeverMarkAsImportant' value='true'/>
<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:1509543652088</id>
<updated>2018-12-20T16:45:46Z</updated>
<content></content>
<apps:property name='to' value='your_activity@noreply.github.com'/>
<apps:property name='hasTheWord' value='approved this pull request'/>
<apps:property name='label' value='👍'/>
<apps:property name='shouldMarkAsRead' value='true'/>
<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:1509629548014</id>
<updated>2018-12-20T16:45:46Z</updated>
<content></content>
<apps:property name='from' value='notifications@github.com'/>
<apps:property name='hasTheWord' value='reopened'/>
<apps:property name='label' value='Reopened'/>
<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:6834376395137621585</id>
<updated>2018-12-20T16:45:46Z</updated>
<content></content>
<apps:property name='hasTheWord' value='from:(notifications@github.com) subject:(&quot;CPLAN-&quot;)'/>
<apps:property name='label' value='CPLAN'/>
<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