GitHub Sponsors webhook receiver and Slack forwarder, written in Node.js
This function is hosted on OpenFaaS Cloud, see the commits page for the build logs. The dashboard is private, but contains runtime logs and metrics.
This function receives and validates a webhook from GitHub Sponsors using the node12 template from OpenFaaS.
Each message is verified using the crypto library and HMAC.
Messages that pass HMAC are then sent over to a secret webhook URL and appear in Slack
It is triggered by any event from GitHub Sponsors
There's a switch statement on each event, which sends send a "pretty" string such as Person X just sponsored you, or Person X cancelled their sponsorship including an appropriate emoticon for the action taken by the user.
-
Fork the repo
-
Add OpenFaaS Cloud integration to your repo, the community cluster is free to use for hosting.
-
Create a channel and add an incoming webhook integration on Slack
-
Create the webhook on GitHub for your URL and enter a webhook secret
-
Seal your own secrets, change
alexellis
for your own username.
export WEBHOOK=""
export SLACK=""
faas-cli cloud seal --name alexellis-sponsors \
--literal webhook-secret=$WEBHOOK \
--literal slack-url=$SLACK
- Fire a test event from your sponsors page
See also: SponsorshipEvent