diff --git a/lib/notify.sh b/lib/notify.sh new file mode 100644 index 0000000..15571c4 --- /dev/null +++ b/lib/notify.sh @@ -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\"}" +}