CI/CD Pipeline Notifications
Get notified when builds pass, fail, or need attention.
CI/CD pipelines run in the background — you need to know when something fails without constantly watching dashboards. Add a curl step to your pipeline and Alphorn routes the result to the right people.
GitHub Actions
Add a notification step at the end of your workflow:
- name: Notify on success
if: success()
run: |
curl -s -X POST ${{ secrets.ALPHORN_WEBHOOK }} \
-H "Content-Type: application/json" \
-d '{
"title": "Deploy succeeded",
"message": "${{ github.repository }} deployed from ${{ github.ref_name }} (commit ${{ github.sha }})",
"priority": 2,
"tags": ["ci", "deploy", "success"]
}'
- name: Notify on failure
if: failure()
run: |
curl -s -X POST ${{ secrets.ALPHORN_WEBHOOK }} \
-H "Content-Type: application/json" \
-d '{
"title": "Deploy FAILED",
"message": "${{ github.repository }} failed on ${{ github.ref_name }}. See: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}",
"priority": 5,
"tags": ["ci", "deploy", "failure"]
}'GitLab CI
notify:
stage: .post
script:
- |
if [ "$CI_JOB_STATUS" = "success" ]; then
PRIORITY=2; TITLE="Pipeline passed"
else
PRIORITY=5; TITLE="Pipeline FAILED"
fi
curl -s -X POST "$ALPHORN_WEBHOOK" \
-H "Content-Type: application/json" \
-d "{
\"title\": \"$TITLE\",
\"message\": \"$CI_PROJECT_NAME on $CI_COMMIT_REF_NAME — $CI_PIPELINE_URL\",
\"priority\": $PRIORITY,
\"tags\": [\"ci\", \"$CI_JOB_STATUS\"]
}"
when: alwaysRouting examples
| Channel | Filter | Purpose |
|---|---|---|
| Slack (#deployments) | tags CONTAINS "deploy" | All deploy activity |
| Slack (#dev) | tags CONTAINS "failure" | Only failures, to avoid noise |
| PagerDuty | priority >= 4 AND tags CONTAINS "failure" | Page on-call for production failures |
tags CONTAINS "ci" | Archive all CI activity |