fix(ci): use env var for Discord webhook secret in if-condition

GitHub Actions doesn't allow secrets context in if expressions.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Lex Christopherson 2026-03-18 11:26:51 -06:00
parent f824bd2007
commit a0a341e3d3

View file

@ -178,11 +178,13 @@ jobs:
--latest
- name: Post to Discord
if: ${{ secrets.DISCORD_CHANGELOG_WEBHOOK != '' }}
if: ${{ env.DISCORD_WEBHOOK != '' }}
env:
DISCORD_WEBHOOK: ${{ secrets.DISCORD_CHANGELOG_WEBHOOK }}
run: |
VERSION="${{ steps.release.outputs.version }}"
NOTES=$(cat /tmp/release-notes.md)
curl -s -X POST "${{ secrets.DISCORD_CHANGELOG_WEBHOOK }}" \
curl -s -X POST "$DISCORD_WEBHOOK" \
-H "Content-Type: application/json" \
-d "$(jq -n --arg c "**GSD v${VERSION} Released**\n\n${NOTES}\n\n\`npm i gsd-pi@${VERSION}\`" '{content:$c}')"