A self-hosted Probot app that delivers push event details to your inbox
probot-messenger
may be used as a self-hosted replacement to the email service that is due to be deprecated on January 31, 2019.
- Register a GitHub App
- Create a SendGrid API key
- Deploy to Heroku
- Update your GitHub App
- Install your GitHub App
- Configure your installation
Register a new GitHub App, providing a GitHub App name
, and Homepage URL
, and having the following properties:
Permissions
Repository contents
: Read only
Event subscriptions
Push
Webhook URL
For now, use a temporary value, such as http://localhost
, we'll come back to this shortly.
Webhook Secret
Be sure to secure your webhooks, to ensure the authenticity of requests from GitHub, by providing a Webhook Secret
. Use a random string with high entropy (e.g., by taking the output of ruby -rsecurerandom -e 'puts SecureRandom.hex(20)'
at the terminal).
Private key
After creating the GitHub App, be sure to generate a private key, store this in a safe place.
Sign up for a free SendGrid account, and create an API key with Mail Send access.
It is recommended to set up domain authentication in SendGrid in order to signal to email providers that SendGrid has permission to send emails on your behalf.
Deploy your app to Heroku, populating the Config Vars
with your GitHub App's APP_ID
, WEBHOOK_SECRET
, and PRIVATE_KEY
, as well as your SendGrid API key, SENDGRID_APIKEY
.
Update your GitHub App's Webhook URL
, with the URL
of your Heroku app.
Install your GitHub App on the account, or repository that you wish to receive email notifications from.
Configure the installed app, by creating a .github/probot-messenger.yml
file in the root of the repository, for example:
---
services:
- name: email
addresses: # a list of addresses to send notifications to
- to@example.com
sender: # the email address of the notification sender
name: From
address: from@example.com
Consider adding your sender.from
address as a contact, to avoid it being flagged as spam.
Once configured, a push to any branch of a configured repository will generate a notification to the addresses defined in your .github/probot-messenger.yml
.