From a492c508b43eef2cff06ba071612557b9697c6ba Mon Sep 17 00:00:00 2001 From: Harlan Wilton Date: Wed, 18 Nov 2026 16:32:31 +1100 Subject: [PATCH] ci(deploy): refuse to deploy public source maps Sentry deletes source maps only after it uploads them, and skew storage restores earlier releases' maps into .output/public. A build without the Sentry token, or a silent delete failure, would serve every map again. The deploy now stops after Build, before migrations or any production change, when .output/public holds a map. --- .github/workflows/deploy-cloudflare.yml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/.github/workflows/deploy-cloudflare.yml b/.github/workflows/deploy-cloudflare.yml index fc292655..55bcc9cc 100644 --- a/.github/workflows/deploy-cloudflare.yml +++ b/.github/workflows/deploy-cloudflare.yml @@ -92,6 +92,18 @@ jobs: # are un-minified and tagged with a release (fixes release: None on SKILLD-1). SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }} + # Sentry deletes source maps only after it uploads them. Skew storage + # restores earlier releases' maps into `.output/public`, so a build + # without the token would serve them. Stop before production changes. + - name: Refuse public source maps + run: | + maps=$(find .output/public -name '*.map') + if [ -n "$maps" ]; then + echo "::error::Source map files in .output/public: $(printf '%s\n' "$maps" | wc -l). Production would serve them." + printf '%s\n' "$maps" | sed -n '1,5p' + exit 1 + fi + - name: Apply D1 migrations run: pnpm db:migrations:prod env: