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

Skip to content

Commit b890e7d

Browse files
fix(.github/workflows): fail when the Slack webhook is missing
The step only runs after the refresh has already failed, so exiting 0 hid the more serious problem: nobody was told. Mark the step red and name the secret, now that it exists and an empty value means a misconfiguration.
1 parent 8ee6bd9 commit b890e7d

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -157,9 +157,11 @@ jobs:
157157
RUN_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
158158
run: |
159159
set -euo pipefail
160+
# Fail loudly: the refresh has already failed at this point, and a
161+
# missing webhook means nobody is being told about it.
160162
if [ -z "${SLACK_WEBHOOK}" ]; then
161-
echo "::warning::AIGATEWAY_PRICES_SLACK_WEBHOOK is not set; skipping notification."
162-
exit 0
163+
echo "::error::AIGATEWAY_PRICES_SLACK_WEBHOOK is not set; the failure alert could not be sent."
164+
exit 1
163165
fi
164166
# printf, not a double-quoted literal: bash leaves \n as two
165167
# characters, and jq --arg then escapes the backslash, so Slack

0 commit comments

Comments
 (0)