fix(cd): keep .env.production Sentry DSN when the GitHub var is empty

An unset vars.VITE_SENTRY_DSN becomes an empty env value and Vite will
not let .env.production overwrite it, which would ship with Sentry off.
This commit is contained in:
Adam Moussa 2026-09-18 15:26:55 -04:00
parent 7ed0743b90
commit 0bf834bb8e
No known key found for this signature in database

View file

@ -145,6 +145,14 @@ jobs:
VITE_SENTRY_RELEASE: ${{ steps.commit.outputs.sha }}
run: |
set -euo pipefail
# vars.VITE_SENTRY_DSN is unset today. An empty env value would
# override .env.production and disable Sentry (Vite does not let
# .env overwrite an existing variable).
if [ -n "${VITE_SENTRY_DSN:-}" ]; then
export VITE_SENTRY_DSN
else
unset VITE_SENTRY_DSN
fi
case "${TARGET_ENVIRONMENT}" in
dev)
export VITE_API_URL="https://api.dev.seahaven.com/api"