From 06ffbc15e9d9164659a9fe063a4332e7868acefd Mon Sep 17 00:00:00 2001 From: Matthew Phillips Date: Fri, 12 Jun 2026 13:19:10 -0400 Subject: [PATCH] fix: exclude main branch from preview site URL --- astro.config.mjs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/astro.config.mjs b/astro.config.mjs index 60a279c3c7..8bcc104951 100644 --- a/astro.config.mjs +++ b/astro.config.mjs @@ -9,10 +9,10 @@ import astroExpressiveCode from 'astro-expressive-code'; import icon from 'astro-icon'; import houston from './houston.theme.json'; -/* On Cloudflare Workers Builds, WORKERS_CI_BRANCH is set to the branch name for non-production deploys */ -const PREVIEW_SITE = process.env.WORKERS_CI_BRANCH - ? `https://${process.env.WORKERS_CI_BRANCH}.previews.astro.build` - : undefined; +/* On Cloudflare Workers Builds, WORKERS_CI_BRANCH is set to the branch name */ +const branch = process.env.WORKERS_CI_BRANCH; +const PREVIEW_SITE = + branch && branch !== 'main' ? `https://${branch}.previews.astro.build` : undefined; // https://astro.build/config export default defineConfig({