Skip to content

Instantly share code, notes, and snippets.

@ldez
Last active November 28, 2024 21:41
Show Gist options
  • Save ldez/bd6e6401ad0855e6c0de6da19a8c50b5 to your computer and use it in GitHub Desktop.
Save ldez/bd6e6401ad0855e6c0de6da19a8c50b5 to your computer and use it in GitHub Desktop.
Gmail and GitHub - Filters

Gmail and GitHub

How to filter emails from GitHub in Gmail and flag them with labels.

The labels in this document are just examples.

Pull Request

Filter Label
from:(notifications@github.com) subject:"PR \#" gh-pull-request

Note: special characters like ( or # are ignored and the escape \ doesn't work.

GitHub Actions

Filter Label
from:(ci_activity@github.com) gha

Discussion

Filter Label
from:(notifications@github.com) subject:"\(Discussion \#) gh-discussion

Releases

Filter Label
from:(notifications@github.com) "Visit the release page to download them." gh-relases

Assignments

Filter Label
from:(notifications@github.com) cc:(assign@noreply.github.com) gh-assignments

Mentions

Filter Label
from:(notifications@github.com) cc:(mention@noreply.github.com) gh-mentions

Review Requested

Filter Label
from:(notifications@github.com) cc:(review_requested@noreply.github.com) "requested your review on" gh-review-requested

GitHub emails

  • subscribed: The notification arrived because you’re watching the repository.
  • manual: The notification arrived because you’ve specifically decided to subscribe to the thread (via an Issue or Pull Request).
  • author: The notification arrived because you’ve created the thread.
  • comment: The notification arrived because you’ve commented on the thread.
  • mention: The notification arrived because you were specifically @mentioned in the content.
  • team_mention: The notification arrived because you were on a team that was mentioned (like @org/team).
  • state_change: The notification arrived because you changed the thread state (like closing an Issue or merging a Pull Request).
  • assign: The notification arrived because you were assigned to the Issue.
  • review_requested: The notification arrived because your review is required.
  • ci_activity: The notification arrived because CI activities (failure, success, ...)
  • push: The notification arrived because of a push

example:

Approximate rules

WARNING: Those rules can produce false-positives.

Closed (~)

label: gh-closed

Filter:

from:(notifications@github.com) "Closed \#"

Note: special characters like ( or # are ignored and the escape \ doesn't work.

Merged (~)

label: gh-merged

Filter:

from:(notifications@github.com) "Merged \#"

Note: special characters like ( or # are ignored and the escape \ doesn't work.

Issue (~)

label: gh-issue

Filter:

from:(notifications@github.com) subject:("Issue \#" -"PR \#")

Note: special characters like ( or # are ignored and the escape \ doesn't work.

References

@erikw
Copy link

erikw commented Jul 27, 2022

ci_activity@noreply.github.com is missing from the list.

@kevinrobayna
Copy link

What kind of rules does people have for GH Actions?

@khavinshankar
Copy link

What kind of rules does people have for GH Actions?

https://gist.github.com/ldez/bd6e6401ad0855e6c0de6da19a8c50b5#github-actions

@sastorsl
Copy link

You can add push@noreply.github.com to the list.

@AntonBelski
Copy link

Very useful!

@maciejsobon
Copy link

Very handy! Cheers :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment