Add Slack notify helper for deployment alerts

This commit is contained in:
Stefan Weber 2026-02-20 10:20:00 +00:00
parent c6641200da
commit 089e305363

11
lib/notify.sh Normal file
View file

@ -0,0 +1,11 @@
#!/bin/bash
# Send a Slack notification via webhook.
# Usage: notify "Deployment of v1.2.3 succeeded" "#deployments"
notify() {
local msg="$1"
local channel="${2:-#ops}"
curl -sf -X POST "$SLACK_WEBHOOK_URL" \
-H "Content-Type: application/json" \
-d "{\"channel\": \"$channel\", \"text\": \"$msg\"}"
}