Skip to content

Fix preview links for long branch names#4469

Merged
lennessyy merged 3 commits intomainfrom
fix/preview-links-long-branch-names
Apr 22, 2026
Merged

Fix preview links for long branch names#4469
lennessyy merged 3 commits intomainfrom
fix/preview-links-long-branch-names

Conversation

@lennessyy
Copy link
Copy Markdown
Contributor

@lennessyy lennessyy commented Apr 22, 2026

Summary

  • When a branch name produces a subdomain over 63 characters, Vercel truncates it with a hash suffix, causing our preview link comment to point to the wrong URL.
  • The workflow now checks the subdomain length first. Short names (≤63 chars) use the constructed URL directly with no added delay.
  • Long names poll for the vercel[bot] comment (up to 3 minutes) and extract the actual preview URL from its base64 payload, falling back to the constructed URL if the comment doesn't appear.

Test plan

  • Verify short branch names still produce correct preview links with no delay
  • Create a test branch with a name long enough to exceed 63 chars in the subdomain (e.g., fix/this-is-a-very-long-branch-name-that-will-exceed-the-dns-label-limit) and confirm the workflow extracts the correct URL from the Vercel comment

🤖 Generated with Claude Code

┆Attachments: EDU-6246 Fix preview links for long branch names

When a branch name produces a subdomain exceeding 63 characters (the
DNS label limit), Vercel truncates it with a hash suffix. Our workflow
constructed the URL independently and got it wrong in those cases.

Now the workflow checks the subdomain length first. Short branch names
use the constructed URL directly with no delay. Long branch names poll
for the Vercel bot comment and extract the actual preview URL from its
base64 payload, falling back to the constructed URL after 3 minutes.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@lennessyy lennessyy requested a review from a team as a code owner April 22, 2026 02:48
@vercel
Copy link
Copy Markdown

vercel Bot commented Apr 22, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
temporal-documentation Ready Ready Preview, Comment Apr 22, 2026 8:58pm

Request Review

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 22, 2026

📖 Docs PR preview links

This PR does not change any pages in /docs. If you make updates, links to the modified pages will appear here.

uses: actions/github-script@v7
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a nit, but could this script be put in a file like preview-base-url.js? It's usually easier to write and maintain these scripts when they're not embedded in the workflow.

Then the package.json > "scripts" section could be updated with something like preview-base-url and then called here like: yarn run preview-base-url.

Moves the inline script from the workflow into a standalone file
for easier maintenance. The workflow now requires it and calls
resolvePreviewUrl with the actions/github-script context.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@lennessyy lennessyy enabled auto-merge (squash) April 22, 2026 20:57
@lennessyy lennessyy merged commit 83e7787 into main Apr 22, 2026
9 checks passed
@lennessyy lennessyy deleted the fix/preview-links-long-branch-names branch April 22, 2026 20:58
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.

2 participants