Query GitHub directly for tag-at-HEAD (bypass Vercel mirror)#33
Merged
Conversation
Previous PR added an ls-remote fallback against `origin`, but Vercel's `origin` points at an internal mirror that lags GitHub by a few seconds when a deploy hook fires immediately after a tag push — so even the fallback returned no tag and the footer kept showing a SHA. Prefer `https://github.com/{owner}/{repo}.git` (built from VERCEL_GIT_REPO_* env vars) over `origin` for the ls-remote step, and prefer VERCEL_GIT_COMMIT_SHA over local rev-parse for the SHA we match against. That bypasses Vercel's mirror entirely for the version lookup. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
https://github.com/{owner}/{repo}.git(fromVERCEL_GIT_REPO_OWNER/SLUG) overoriginwhen ls-remoting for the tag at HEAD.VERCEL_GIT_COMMIT_SHAover localgit rev-parsefor the SHA we match against.Why
PR #32's
originfallback didn't help — Vercel'soriginis an internal mirror that lags the actual GitHub repo by seconds when a deploy hook fires immediately after a tag push. The build forad829b3happened before the mirror saw the new tag, so even the fallback returned nothing andgit describe --tags --alwaysproduced the short SHA.Querying GitHub directly bypasses Vercel's mirror entirely. Local builds and CI without Vercel env vars still use
origin.Test plan
python3 -m unittest discover -s test/build— 8 tests).python3 build.py --checkclean.🤖 Generated with Claude Code