A Github bot helping you pick reviewers for Pull Requests
This simple bot will pick reviewers for you in a PR. You can summon him
by writing something like
@ghreviewbot assign frontend reviewers where
the team name could be any team you configured. I'll respond with 2 randomly
selected reviewers, one senior team member and one junior.
This bot is written in Go and requires mainly 3 things to work:
issue_commentevent in your Github repository's settings
Here's what happens on a typical use of this bot:
POSTrequest to the configured
https://boturl/hooks/githubfrom the webhook settings
issue_commenttype and that it was
There we go, a simple bot for narrow and simple use case.
This bot requires to following environment variables to be in a
.env at the root when developing or on you server configuration in production:
GITHUB_TOKEN: A personal access token to make Github API calls (usually from the bot account)
BOT_NAME: The name you want you bot to answer to (usually the bot's account username)
BOT_TEAM_<any-team-name>: The list of reviewers Github usernames that the bot will select from. Individual usernames separated by commas (
,) and seniors separated from the juniors list by a pipe (
Next, you also need a webhook that looks a bit like the following screenshot on the repo you want your bot to be watching for comments:
This bot is easily deployable to Heroku either by using the button below or creating a new app in the dashboard and deploying this repo to it.
To develop a new feature for this bot you can use a combination of:
make run& a filled in
ngrokand creating a webhook on a test repo with that ngrok url in it
That equates to the following commands:
cat > .env <<EOF >GITHUB_TOKEN=<a valid github personal token> >BOT_NAME=<the name you want to bot to have> >BOT_TEAM_SOMENAME=senior1,senior2|junior1,junior2,junior3,junior4 >EOF make run ngrok start 5000
All contributions are welcomed and will be accepted in the form of pull requests or issues on this repo.
If you want to change how bot behaves in a major way without keeping backwards compatibility for the initial use case consider forking this repository and going from there.