Use this GitHub action to inform yourself or your team about activity in your repository. Think of use cases like:
- sending your team a notification when an issue is labelled
critical - sending devops a notification when a deployment fails
- sending yourself a notification when a new pull request is opened
- sending the contributor a notification when their pull request is merged
- sending a Slack message to your announcements channel on a new release
MagicBell also offers a GitHub Workflow Builder that let's you listen to webhook events and trigger notifications!
name: 'Notify Me'on: pull_requestjobs:
notify:
runs-on: ubuntu-lateststeps:
- name: Send Notificationuses: magicbell/action/notify@v1with:
api-key: ${{ secrets.MAGICBELL_API_KEY }}api-secret: ${{ secrets.MAGICBELL_API_SECRET }} recipients: 'person@example.com, bot@example.com'title: 'Activity on pull ${{ github.event.number }}!'The notify action accepts a number of options. The following options are required for all calls:
api-keyString
Your project api key which can be found on the MagicBell Dashboard. This key is required for all calls.
api-secretString
Your project api secret which can be found on the MagicBell Dashboard. This key is required for project oriented endpoints.
titleString
The title of the notification.
recipientsString
A comma (
,) separated list of recipients, currently limited to email addresses.
The following options are optional:
contentString
The content of the notification.
categoryString
The category of the notification. This can be used to group notifications together.
topicString
The topic of the notification. This can be used to thread notifications.
action-urlString
The URL to which the notification will link to.
custom-attributesJSON
A JSON string of custom attributes to be attached to the notification. Tip; use the GitHub
${{ toJson(...) }}helper.overridesJSON
A JSON string of delivery overrides to be attached to the notification. Tip; use the GitHub
${{ toJson(...) }}helper.
name: 'Notify Contributor'on: pushjobs:
notify:
runs-on: ubuntu-lateststeps:
- name: Send Notificationuses: magicbell/action/notify@v1with: # api-key, api-secret, recipients and title are required.api-key: ${{ secrets.MAGICBELL_API_KEY }}api-secret: ${{ secrets.MAGICBELL_API_SECRET }}recipients: '${{ github.event.pusher.email }}'title: 'Thanks for pushing!'name: 'Notify on pull request'on: pull_requestjobs:
notify:
runs-on: ubuntu-lateststeps:
- name: Send Notificationuses: magicbell/action/notify@v1with: # api-key, api-secret, recipients and title are required.api-key: ${{ secrets.MAGICBELL_API_KEY }}api-secret: ${{ secrets.MAGICBELL_API_SECRET }} recipients: '${{ secrets.MY_EMAIL }}'title: 'Activity on pull ${{ github.event.number }}!'action-url: 'https://github.com/${{ github.repository }}/pulls/${{ github.event.number }}'name: On Releaseon:
release:
types: [published]jobs:
notify:
name: Send Release Notesruns-on: ubuntu-lateststeps:
- name: Send Notificationuses: magicbell/action/notify@v1with:
api-key: ${{ secrets.MAGICBELL_API_KEY }}api-secret: ${{ secrets.MAGICBELL_API_SECRET }}recipients: ${{ secrets.MY_EMAIL }}title: 'Just Released: ${{ github.event.release.name }}!'content: ${{ github.event.release.body }}action-url: ${{ github.event.release.html_url }}name: On Issue Createdon:
issues:
types: [opened]jobs:
notify-me:
runs-on: ubuntu-lateststeps:
- name: Send Notificationuses: magicbell/action/notify@mainwith:
api-key: ${{ secrets.MAGICBELL_API_KEY }}api-secret: ${{ secrets.MAGICBELL_API_SECRET }}recipients: '${{ secrets.MY_EMAIL }}'title: 'Issue created: ${{ github.event.issue.number }} - ${{ github.event.issue.title }}'content: ${{ github.event.issue.body }}action-url: ${{ github.event.issue.html_url }}custom-attributes: ${{ toJSON(github.event.issue) }}name: On Issue Labeled Criticalon:
issues:
types: [labeled]jobs:
notify:
if: github.event.label.name == 'critical'runs-on: ubuntu-lateststeps:
- name: Send Notificationuses: magicbell/action/notify@v1with:
api-key: ${{ secrets.MAGICBELL_API_KEY }}api-secret: ${{ secrets.MAGICBELL_API_SECRET }}recipients: ${{ secrets.MY_EMAIL }}title: 'Issue declared critical: ${{ github.event.issue.number }} - ${{ github.event.issue.title }}'