A micro-service to automatically comment on and close issues opened by bothersome users.
MIT License
A micro-service to automatically comment on and close issues opened by bothersome users.
Any time a blacklisted GitHub user opens an issue or pull request, Troll Repellant automatically closes the issue and comments with a polite, but firm message of your choosing.
Troll repellent is tiny Sinatra app designed to run on services like Heroku. You'll need to do two things, configure the server and configure the webhook on GitHub.
You need a Ruby server with the following environmental variables:
GITHUB_TOKEN
- A personal access token of a bot accountGITHUB_COMMENT_GIST_ID
- ID of a Gist with content of the desired commentGITHUB_HOOK_SECRET
- Secret shared with webhook to authenticate payloadGITHUB_REPO
- Name of GitHub repo in the form of owner/repo
GITHUB_BLACKLIST
- Comma separated list of GitHub usernames to blacklistIf not using a service like Heroku, you can start the server with the script/server
command.
Navigate to the repository's settings, and create a new webhook with the following settings:
[SERVER URL]/payload
application/json
GITHUB_HOOK_SECRET
)That's it. The hook should automatically fire each time an issue or pull request is opened, and will comment on and close any issue opened by a blacklisted user.
script/bootstrap
script/server
You'll also probably want to install ngrok to test the hooks locally.