A simple Cloudflare Worker to receive a GitHub Webhook and send member/collaborator add/remove events to Slack.
Requires the following:
- GitHub organisation with admin access to set up webhooks
- Slack workspace with an incoming webhook to post to a channel
- A Cloudflare account
Clone this repository and set the following environment variables:
CF_ACCOUNT_ID
- the Cloudflare account ID from your dashboardCF_API_TOKEN
- a Cloudflare API token - use the "Edit Cloudflare Workers" templateAPI_SECRET
- the shared secret that will be used to sign the GitHub payloadsSLACK_WEBHOOK
- the Slack incoming webhook URL
You can also change wrangler.toml
to alter the worker name or define custom routes.
Create a Github webhook and set the following settings:
- Payload URL - your worker URL (e.g. https://github-member-log.ACCOUNT.workers.dev) or custom route
- Content type - application/json
- Secret - the shared secret from above
- Events to trigger the webhook:
- Collaborator add, remove, or changed
- Organizations