A red X on GitHub is easy to miss if you are not staring at the Actions tab. Emails from GitHub drown in the same inbox as newsletters. Teams look for GitHub Actions Slack notifications because they want the failure where they already talk.
You do not need a marketplace Slack Action per channel. One curl to AlertHub on failure(), then Slack, Telegram, WhatsApp, Discord, or Teams all receive the same critical (or warning) event.
This is different from repository webhooks (pushes, PRs, issues). Here the pipeline itself reports that a job died.
What you should alert on
| Event | GitHub context | Suggested level | Why it matters |
|---|---|---|---|
| Job / workflow failed | if: failure() | Critical | Broken main or a blocked release |
| Deploy job failed | if: failure() on the deploy job | Critical | Production did not ship |
| Flaky test on a PR | if: failure() | Warning | Noise; still worth a dashboard row |
| Successful nightly | if: success() | Info | History only — do not ping Slack |
Only warning and critical are pushed to external channels. Successful builds should stay info (or be omitted).
Setup (once)
- Create a project at app.thealerthub.com and copy the secret key.
- In the GitHub repo: Settings → Secrets and variables → Actions → add
ALERTHUB_KEY. - Connect destinations in AlertHub. Telegram is enough for a solo maintainer; Slack for the team channel.
Docs: GitHub Actions integration.
Alert 1: Workflow failed (the default)
Add a step that runs only when something already failed. Keep the key in secrets, never in YAML.
name: CI
on: [push]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Run Tests
run: npm test
- name: Send Alert to AlertHub
if: failure()
run: |
curl -X POST 'https://api.thealerthub.com/sendAlert' \
-H 'Content-Type: application/json' \
-d '{
"ah_key": "${{ secrets.ALERTHUB_KEY }}",
"ah_title": "GitHub Action failed: ${{ github.workflow }}",
"ah_description": "Repo ${{ github.repository }} on ${{ github.ref }}. Run: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}",
"ah_level": "critical",
"ah_source": "GitHub Actions"
}'
Push a commit that fails tests, then confirm the alert in the dashboard and on your channels.
Alert 2: Failed deploy job only
Monorepos often have a green test job and a red deploy job. Scope the step to the job that ships:
- name: Notify AlertHub deploy failed
if: failure()
run: |
curl -X POST 'https://api.thealerthub.com/sendAlert' \
-H 'Content-Type: application/json' \
-d '{
"ah_key": "${{ secrets.ALERTHUB_KEY }}",
"ah_title": "Deploy failed on ${{ github.ref_name }}",
"ah_description": "Workflow ${{ github.workflow }} — ${{ github.actor }}",
"ah_level": "critical",
"ah_source": "GitHub Deploy"
}'
Netlify and Vercel can notify without Actions — see Netlify deploys and Vercel deployment alerts. Use Actions when the pipeline is the source of truth.
Alert 3: Organization-wide secret
For agencies and many repos, define ALERTHUB_KEY as an organization secret (or environment secret per prod). Same AlertHub project, ah_source set to the repo name so the feed stays filterable.
Ideas to squeeze more value
- Do not alert on every PR flake.
if: failure() && github.ref == 'refs/heads/main'keeps Slack quiet. - Include the run URL. The description above opens the failed run in one tap.
- Reuse destinations. When the team leaves Slack for Teams, you change AlertHub once — not twenty workflow files.
- Combine with repo webhooks. Failures via Actions; PR review pings via GitHub webhooks.
FAQ
Why not a Slack GitHub Action?
That Action only talks to Slack. AlertHub is the last hop so WhatsApp, Telegram, and Discord stay in sync.
Is curl available on GitHub-hosted runners?
Yes on ubuntu-latest. For Windows runners, use PowerShell Invoke-RestMethod against the same URL.
Can I send info on success?
Yes, with if: success() and "ah_level": "info". It will not fan out to channels.
Next steps
Copy the failure step from the GitHub Actions docs, add ALERTHUB_KEY, and connect Slack or Telegram.
Related: GitHub repository webhooks · Vercel deployment alerts