Get automated Github Pull Requests notification for individual team members or on your team's channel on Slack
This application is developed for corporate employees who may not be able to configure Github-Slack integration due restrictions behind corporate networks.
-
Create a Github Personal Access Token which will be used to lookup github username/full name.
-
Create a Slack Application which will be used to configure Slack Bot.
-
Create a Slack Bot using the application created in previous step. Give appropriate read and write scopes to your bot.
-
Clone this repo and deploy it on a dedicated server in your corporate network/cloud. For demo purpose, I have deployed this on Heroku. Make sure that
app.py
is configured as starting point of the application on your host. -
Create a custom Github Webhook in a repo whose Pull Request notifications you want to trigger.
If host address isabc.com
, put webhook URL asabc.com/hooks
Put a strong webhook secret and make a note of it. -
Configure a new/existing channel to be used as default in case a username is not resolved. Add your Slack Bot in this channel.
-
Setup following Environment Variables on your server:
SLACK_BOT_TOKEN=[YOUR SLACKBOT TOKEN] GITHUB_API_TOKEN=[YOUR GITHUB API TOKEN] GITHUB_API_USER=[YOUR GITHUB USERNAME] GITHUB_WEBHOOKS_KEY=[YOUR GITHUB WEBHOOK SECRET] DEFAULT_NOTIFICATION_CHANNEL=[YOUR DEFAULT SLACK CHANNEL]
-
Thats it. Now create a pull request, assign it to yourself or request review from someone and see the notification triggered on your Slack.
Trigger notification when a pull request is reviewed and approved or change(s) requested.