Browse Docs

GitHub Actions

Send API Alerts notifications directly from your GitHub Actions workflows. Get notified on deployments, test results, releases, and more.

Usage

- name: Notify
  uses: apialerts/notify-action@v2
  with:
    api_key: ${{ secrets.API_ALERTS_KEY }}
    message: "Deployment successful"

Inputs

InputRequiredDescription
api_keyYesYour API Alerts workspace API key
messageYesThe notification message
channelNoTarget channel (defaults to workspace default)
linkNoURL to attach to the notification
tagsNoComma-separated tags for categorization

Examples

Notify on success or failure

Use if: success() || failure() to send a notification no matter the outcome but with different messages. The link field lets you jump straight to the build artifact on success or the Actions run on failure.

- name: Notify
  if: success() || failure()
  uses: apialerts/notify-action@v2
  with:
    api_key: ${{ secrets.API_ALERTS_KEY }}
    channel: 'developer'
    message: ${{ job.status == 'success' && '🚀 Deployed to staging' || '❌ Staging build failed' }}
    tags: 'deploy,staging'
    link: ${{ job.status == 'success' && 'https://appdistribution.firebase.google.com/testerapps/YOUR_APP_ID' || format('{0}/{1}/actions/runs/{2}', github.server_url, github.repository, github.run_id) }}

Deployment notification

- name: Notify
  if: success()
  uses: apialerts/notify-action@v2
  with:
    api_key: ${{ secrets.API_ALERTS_KEY }}
    message: "Deployed ${{ github.sha }} to production"
    channel: 'releases'
    link: "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"
    tags: 'deploy,production'

Test failure notification

- name: Notify
  if: failure()
  uses: apialerts/notify-action@v2
  with:
    api_key: ${{ secrets.API_ALERTS_KEY }}
    message: "Tests failed on ${{ github.ref_name }}"
    channel: 'ci'
    tags: 'tests,failure'

Resources