From 0bf834bb8ee53be770041ad6c47e3b10a29d2fcc Mon Sep 17 00:00:00 2001 From: Adam Moussa Date: Fri, 18 Sep 2026 15:26:55 -0400 Subject: [PATCH] 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. --- .github/workflows/deploy-web.yaml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.github/workflows/deploy-web.yaml b/.github/workflows/deploy-web.yaml index 96502f69..33e63955 100644 --- a/.github/workflows/deploy-web.yaml +++ b/.github/workflows/deploy-web.yaml @@ -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"