Github Release Published Notification to Slack & Email
Use the Github integration by MagicBell to setup a workflow when release triggers in Github.
Connect Github to MagicBell to receive events and trigger workflows. This guide uses the MagicBell CLI.
Add the Github integration
Save your Github webhook signing secret in MagicBell. See GitHub webhooks.
magicbell integration save_github \
--data '{"webhook_signing_secret":"your_secret_here"}'Copy the ID from the response and use it to build your webhook URL:
https://api.magicbell.com/v2/integrations/github/webhooks/incoming/{id}Setup the webhook
- Setup a webhook in Github with the URL from the last step.
- Select the release event.
- If you already have a webhook configured, make sure it includes this event.
Add a workflow
Create a workflow that triggers automatically when Github sends this event.
Workflow key
Use this key to trigger the workflow when Github sends a release event:
integration.github.releaseFilter by action: GitHub sends the event type in the header and the action in the payload body. Use an if condition to filter for the published action:
"if": "payload.action == 'published'"Example workflow
Announce new releases to the team and stakeholders. Notify via Slack and email with release notes.
{
"key": "integration.github.release",
"steps": [
{
"if": "payload.action == 'published'",
"command": "broadcast",
"input": {
"action_url": "{{payload.release.html_url}}",
"content": "{{payload.repository.full_name}} {{payload.release.tag_name}} has been published by {{payload.sender.login}}.",
"overrides": {
"providers": {
"email": {},
"slack": {}
}
},
"recipients": [
{
"external_id": "all-team"
}
],
"title": "Release {{payload.release.tag_name}}: {{payload.release.name}}"
}
}
]
}Save with the CLI
Use the MagicBell CLI to save this workflow to your project. You can also use the Workflows API endpoint instead.
magicbell workflow save \
--data '{"key":"integration.github.release","steps":[{"if":"payload.action == 'published'","command":"broadcast","input":{"action_url":"{{payload.release.html_url}}","content":"{{payload.repository.full_name}} {{payload.release.tag_name}} has been published by {{payload.sender.login}}.","overrides":{"providers":{"email":{},"slack":{}}},"recipients":[{"external_id":"all-team"}],"title":"Release {{payload.release.tag_name}}: {{payload.release.name}}"}}]}'Event payload
Sample payload for the release event. Use liquid templates to access fields in your workflow.
{
"action": "published",
"organization": {
"avatar_url": "https://avatars.githubusercontent.com/u/111111",
"description": "Building great software",
"id": 111111,
"login": "acme"
},
"release": {
"assets": [
{
"browser_download_url": "https://github.com/acme/project/releases/download/v2.1.0/project-v2.1.0-linux-amd64.tar.gz",
"download_count": 0,
"id": 111222333,
"name": "project-v2.1.0-linux-amd64.tar.gz",
"node_id": "RA_kwDOABC123",
"size": 12345678
}
],
"author": {
"avatar_url": "https://avatars.githubusercontent.com/u/345678",
"html_url": "https://github.com/release-manager",
"id": 345678,
"login": "release-manager",
"node_id": "MDQ6VXNlcjM0NTY3OA==",
"type": "User"
},
"body": "## What's Changed\n- Added OAuth2 authentication\n- Fixed memory leak in cache\n- Improved API response times\n\n## Contributors\n- @john-dev\n- @jane-developer",
"created_at": "2025-01-15T16:00:00Z",
"draft": false,
"html_url": "https://github.com/acme/project/releases/tag/v2.1.0",
"id": 123456789,
"name": "Version 2.1.0",
"node_id": "RE_kwDOABC123",
"prerelease": false,
"published_at": "2025-01-15T16:00:00Z",
"tag_name": "v2.1.0",
"tarball_url": "https://api.github.com/repos/acme/project/tarball/v2.1.0",
"target_commitish": "main",
"zipball_url": "https://api.github.com/repos/acme/project/zipball/v2.1.0"
},
"repository": {
"default_branch": "main",
"description": "A sample project",
"full_name": "acme/project",
"html_url": "https://github.com/acme/project",
"id": 987654321,
"name": "project",
"node_id": "MDEwOlJlcG9zaXRvcnk5ODc2NTQzMjE=",
"owner": {
"avatar_url": "https://avatars.githubusercontent.com/u/111111",
"html_url": "https://github.com/acme",
"id": 111111,
"login": "acme",
"type": "Organization"
},
"private": false,
"visibility": "public"
},
"sender": {
"avatar_url": "https://avatars.githubusercontent.com/u/345678",
"html_url": "https://github.com/release-manager",
"id": 345678,
"login": "release-manager",
"node_id": "MDQ6VXNlcjM0NTY3OA==",
"type": "User"
}
}