Generates an XML file which can be uploaded to mass create gmail email filters for Github listservs.
This is an opinionated script to create mass create Github filters. It may be useful if you have Github notifications turned on for many repos and prefer to use email to review notifications.
Here is an example of what this would look like:
- Create a local virtual environment and source it
python3 -m venv ./venv && source ./venv/bin/activate
- Run the script
> python main.py -h
usage: main.py [-h] -r REPOS -l LABEL -s LISTSERV [-f FILEPATH]
Parse command line arguments.
options:
-h, --help show this help message and exit
-r REPOS A list of repositories separated by commas
-l LABEL The label prefix to be used within email filters. e.g. Github
-s LISTSERV The suffix of the listserv, e.g. ROKT.github.com
-f FILEPATH An optional filepath to save the output XML file. Defaults to ./filters.xml
> python main.py -r signal-processor,necromancer -l 'CCDP Github' -s 'ROKT.github.com' && cat filters.xml
This will write a file called filters.xml to the local directory.
- Click the gear icon and click “See all settings”.
- Navigate to the “Filters and Blocked Addresses” page. Alternatively, you ought to be able to use this link.
- Click “Choose File” and select the email filter you’d like to import. Click “Open File”.
- Be sure to click “Apply new filters to existing email”
- Then click “Create filters” and you should have your new filters.