fix: escape bash variables in notify step (35784VAR)

This commit is contained in:
Chris Christiansen 2026-05-26 01:44:24 +00:00
parent b79be272c2
commit cda1ef9157

View File

@ -62,14 +62,14 @@ steps:
args: args:
- '-c' - '-c'
- | - |
_WH_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 "$_WH_URL" ]]; then if [[ -n "$$WH_URL" ]]; then
_NOTIFY_MSG="✅ *OSVauco Deploy fullført*\nCommit: \`$COMMIT_SHA\`\nService: \`${_CLOUD_RUN_SERVICE}\`\nRegion: \`${_REGION}\`" NOTIFY_MSG="✅ *OSVauco Deploy fullført*\nCommit: \`$COMMIT_SHA\`\nService: \`${_CLOUD_RUN_SERVICE}\`\nRegion: \`${_REGION}\`"
curl -s -X POST "$_WH_URL" \ curl -s -X POST "$$WH_URL" \
-H 'Content-Type: application/json' \ -H 'Content-Type: application/json' \
-d "{\"text\": \"$_NOTIFY_MSG\"}" || true -d "{\"text\": \"$$NOTIFY_MSG\"}" || true
echo "✓ Deploy-notifikasjon sendt" echo "✓ Deploy-notifikasjon sendt"
else else
echo "⚠️ Ingen webhook-url i Secret Manager — hopper over varsling" echo "⚠️ Ingen webhook-url i Secret Manager — hopper over varsling"