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
| Input | Required | Description |
|---|---|---|
api_key | Yes | Your API Alerts workspace API key |
message | Yes | The notification message |
channel | No | Target channel (defaults to workspace default) |
link | No | URL to attach to the notification |
tags | No | Comma-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
- GitHub Marketplace
- GitHub Actions integration
- Mobile CI/CD build alerts for a full walkthrough with Android and iOS examples