A custom made bot for Slack that notifies on a Slack channel when a Pull Request or a Comment in a Pull Request Review is made.
The message sent to Slack comes with the @here
tag and forces the notification to show.
Malandroid Bot runs on .NET Core@Azure Functions because IoT with Adafruit.IO is also present on the project (Malandroid Bot is the software brother of PRInformer 🤖) and because why not?
- Visual Studio or Visual Studio Code (for VS Code install .NET Core and Azure Functions extension for VS Code)
- An Azure account (Microsoft Azure offers some free credit to test their platform, also they offer 12 months of some popular services so you're good to go with it and do some testing)
- A Slack Webhook to send the messages
- Github privilegies to add Webhooks to a repo (or contact with someone who has the proper access to do that)
- Populate the
SLACK_HOOK_URL
onConsts.cs
with your Slack incoming webhook (Check this link to know how to add one). - If you are not planning to use the PRInformer (😞) remove the
SendAdafruitData
call on the fileOnPullRequest.cs
or you may have some issues while executing your Function. - In case you also want to use PRInformer follow the instructions on the PRInformer README and copy the Adafruit Feed id and paste it on the placeholder
FEED_ID
string at the method annotation onAdafruitService.cs
. Again, if you forgot to replace it you may have runtime issues.
Publish your app on Azure Functions. when done go to the azure console and grab the functions URLs (each function have different URL)
Go to your Repo settings and enter to Webhooks section then click the Add webhook button on the top right. (You may be prompted to enter your Github password)
On the Payload URL field put one of your functions URL (remember which one it was), change the Content-Type and click on Let me select individual events, then check only Pull requests if you added the OnPullRequest URL or Pull request review comments if you added the OnPullRequestComment on the payload url field.
Press the Add webhook and repeat the steps for the other function.