You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Select the failure alert or no-change heartbeat in one final step. This
removes duplicated webhook validation, JSON encoding, and curl setup, and
prevents a failed heartbeat delivery from triggering a second, contradictory
failure notification.
echo "::error::AIGATEWAY_PRICES_SLACK_WEBHOOK is not set; the failure alert could not be sent."
170
+
if [ "${REFRESH_STATUS}" = "failure" ]; then
171
+
# printf, not a double-quoted literal: bash leaves \n as two
172
+
# characters, and jq --arg then escapes the backslash, so Slack
173
+
# would print \n as text instead of breaking the line.
174
+
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}")"
175
+
elif [ "${PRICE_BOOK_CHANGED}" = "false" ]; then
176
+
text=":white_check_mark: *AI Gateway price book refresh completed.* No generated changes were found. Run: ${RUN_URL}"
# printf, not a double-quoted literal: bash leaves \n as two
184
-
# characters, and jq --arg then escapes the backslash, so Slack
185
-
# would print \n as text instead of breaking the line.
186
-
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}")"
181
+
187
182
payload="$(jq -nc --arg text "${text}" '{text: $text}')"
188
183
curl -fsSL -X POST -H 'Content-type: application/json' -d "${payload}" "${SLACK_WEBHOOK}"
0 commit comments