cleaning service for your dirty pull requests
Make sure you have python and python-pip installed. From the project folder run:
sudo pip install -r requirements.txt
This tool uses PyGithub
library for communication with GitHub. Authentication is handled by providing environmental variable GITHUB_TOKEN
which should be generated using instructions from github help pages.
export GITHUB_TOKEN='{TOKEN}'
In order to clean your pull requests you'll also need to provide repository name and define filter function.
You can use this super secret command to get a list of all your repositories.
python github-cleaner list_repos
Last step is to provide a function which will determine whether comment should be deleted.
To do this simply overwrite method should_delete
.
def should_delete(comment):
return any([
'Killer feature, ship it immediately' in comment.body,
comment.user.login == 'borzecki'
]),
Now simply run this command with chosen repository:
python github-cleaner clean_pulls --name={REPOSITORY_NAME}