github_watcher¶
github_watcher watches for pull requests on repositories you specify. When it finds them, it checks them against directories, files, and lines in which you’re interested in keeping an eye out for changes. If something is changed, it will send you a desktop notification (Linux and OSX only).
This project is developed in Python3. You can install it with pip3 from the python package index:
pip3 install github_watcher
After that it will be added to your PATH. To get it configured and running on your machine you can either add your own configuration manually (details below) or you can run
github-watcher config
To run through a prompt. It will write a file at ~/.github-watcher.yml. Feel free to modify that file as your needs change.
For more information on configuration and authentication, check out these primers.
Running github_watcher¶
To set up github_watcher as a daemon, you can just run it like
github-watcher run
If something is going funky you can get verbose output like
github-watcher run --verbose
There are a bunch of other options you can pass. Get a complete listing by passing the “help” flag
github-watcher --help
This module implements methods to sanitize your code base. It automates some best practices such as
- Enforce users to fork rather than branching off the organization code base
- Close/delete branches and pull requests that match particular criteria
- Comment on branches that match certain criteria
The supported actions vary based on whether you’re operating on a pull request or a branch.
Branches | Pull Requests |
---|---|
Delete | Close |
Comment |
Available CLI arguments include
CLI Argument | Argument | Default | Description |
---|---|---|---|
–older-than | YYYY-MM-DD | None | Branches and pull requests last updated before this date will be matched. |
–dry-run | (none) | False | Will print out what would happen, but doesn’t apply any changes. |
–close | (none) | False | If passed; will close matched pull requests unless –dry-run is also passed. |
–delete | (none) | False | If passed; will delete matched branches. |
–comment | str | “” | If passed; will comment on matched pull requests with the argument passed. |