Many projects keep their knowledge base in GitHub wiki. Many of us use Slack. Some of us would like to be notified when pages are being created/edited, and unfortunately this is not supported by GitHub.
GitHub Webhook is not format compatible with Slack Webhook handler.
This project is a shim between GitHub Webhook and Slack Webhook handler performing a trivial JSON transformation that on a free Heroku tier.
git clone [email protected]:pirj/gollum-slack.git
cd gollum-slack
heroku create
git push heroku master
WEBHOOK_PATH=$(base64 /dev/urandom | tr -d 'A-Z/+' | head -c 32)
heroku config:set WEBHOOK_PATH=$WEBHOOK_PATH
heroku config:set SLACK_URI=https://hooks.slack.com/services/BLAH/BLAH/WOOBAHDOOBAH
Use URL that consists of 'Web URL' from heroku info
and path from echo $WEBHOOK_URL
Basically Slack is expecting webhook in the following format:
{
"text": "New Help Ticket Received: http://domain.com/ticket/123456"
}
More information here: https://api.slack.com/custom-integrations
#{sender.login} has #{pages.first.action} page '#{pages.first.title}' at #{pages.first.html_url}
Usually resulting in something like
pirj has created page 'Home' at https://github.com/pirj/gollum-slack/wiki/Home
https://developer.github.com/v3/activity/events/types/#gollumevent
No, there is no event for page delete.
No, Edit Message is not in payload.
There is a SHA-1 of this revision in payload, but there is no link to compare this to previous revision, and previous revision SHA-1 is not in payload.