Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 8ee6bd9

Browse files
fix(.github/workflows): send a real newline in the Slack alert
The alert built its text in double quotes, so bash kept \n as two characters and jq --arg escaped the backslash. Slack printed a literal \n mid-sentence instead of breaking the line; build the text with printf.
1 parent ff7cf11 commit 8ee6bd9

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

.github/workflows/aigateway-prices-refresh.yaml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,10 @@ jobs:
161161
echo "::warning::AIGATEWAY_PRICES_SLACK_WEBHOOK is not set; skipping notification."
162162
exit 0
163163
fi
164-
text=":warning: *AI model price book refresh failed.*\nThe generator fails by design when upstream drops a model pinned in scripts/aibridgepricesgen/overrides.jq or curated in curation.json. Logs: ${RUN_URL}"
164+
# printf, not a double-quoted literal: bash leaves \n as two
165+
# characters, and jq --arg then escapes the backslash, so Slack
166+
# would print \n as text instead of breaking the line.
167+
text="$(printf ':warning: *AI model price book refresh failed.*\nThe generator fails by design when upstream drops a model pinned in scripts/aibridgepricesgen/overrides.jq or curated in curation.json. Logs: %s' "${RUN_URL}")"
165168
payload="$(jq -nc --arg text "${text}" '{text: $text}')"
166169
curl -fsSL -X POST -H 'Content-type: application/json' -d "${payload}" "${SLACK_WEBHOOK}"
167170
echo "Sent Slack notification"

0 commit comments

Comments
 (0)