fix: rename WEBHOOK_URL to WH_URL to avoid Cloud Build substitution parse error

This commit is contained in:
Chris Christiansen 2026-05-24 02:05:49 +00:00
parent d84ea0d5c3
commit e814f406b2

View File

@ -62,12 +62,12 @@ steps:
args: args:
- '-c' - '-c'
- | - |
WEBHOOK_URL=$(gcloud secrets versions access latest \ WH_URL=$(gcloud secrets versions access latest \
--secret=webhook-url \ --secret=webhook-url \
--project=${PROJECT_ID} 2>/dev/null || echo "") --project=${PROJECT_ID} 2>/dev/null || echo "")
if [[ -n "$WEBHOOK_URL" ]]; then if [[ -n "$WH_URL" ]]; then
MSG="✅ *OSVauco Deploy fullført*\nCommit: \`$COMMIT_SHA\`\nService: \`${_CLOUD_RUN_SERVICE}\`\nRegion: \`${_REGION}\`" MSG="✅ *OSVauco Deploy fullført*\nCommit: \`$COMMIT_SHA\`\nService: \`${_CLOUD_RUN_SERVICE}\`\nRegion: \`${_REGION}\`"
curl -s -X POST "$WEBHOOK_URL" \ curl -s -X POST "$WH_URL" \
-H 'Content-Type: application/json' \ -H 'Content-Type: application/json' \
-d "{\"text\": \"$MSG\"}" || true -d "{\"text\": \"$MSG\"}" || true
echo "✓ Deploy-notifikasjon sendt" echo "✓ Deploy-notifikasjon sendt"