Skip to content

fix: exclude main branch from preview site URL - #2466

Merged
matthewp merged 1 commit into
mainfrom
fix/preview-site-main-branch
Jun 12, 2026
Merged

fix: exclude main branch from preview site URL#2466
matthewp merged 1 commit into
mainfrom
fix/preview-site-main-branch

Conversation

@matthewp

Copy link
Copy Markdown
Contributor

On Cloudflare Workers Builds, WORKERS_CI_BRANCH is set to the branch name even on main, which caused the site URL to be overridden to main.previews.astro.build instead of astro.build.

This adds a check to exclude main from preview site URL generation so production deploys use the correct site URL.

Fixes the issue noted in #2432 (comment)

@netlify

netlify Bot commented Jun 12, 2026

Copy link
Copy Markdown

Deploy Preview for astro-www-2 ready!

Name Link
🔨 Latest commit 06ffbc1
🔍 Latest deploy log https://app.netlify.com/projects/astro-www-2/deploys/6a2c3fba13aa5e0008fed98b
😎 Deploy Preview https://deploy-preview-2466--astro-www-2.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Jun 12, 2026

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Updated (UTC)
✅ Deployment successful!
View logs
astro-build 06ffbc1 Jun 12 2026, 05:24 PM

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Jun 12, 2026

Copy link
Copy Markdown

🚀 Deploying Preview to Cloudflare 🚀

Preview URL: https://fix-preview-site-main-branch.previews.astro.build (commit 06ffbc1)

This URL reflects your latest Preview deployment

Preview Deployments by commit

Status Deployment URL Commit Updated (UTC) See this deployment's details
  • Build: Success ✅
  • Deployment: Success ✅

View logs ↗
https://b03620c4.previews.astro.build 06ffbc1 2026-06-12T17:23:30.763Z Visit the dashboard ↗

@matthewp
matthewp merged commit 3e32b7e into main Jun 12, 2026
8 checks passed
@matthewp
matthewp deleted the fix/preview-site-main-branch branch June 12, 2026 17:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant