Repository navigation
ci: Let the Vercel ignore step fetch master despite the missing origin remote - #4212
Conversation
…n remote Vercel's build clone has no `origin` remote, so every `git fetch origin` in vercel-ignore.sh failed and the step fell back to building. Add the remote from VERCEL_GIT_REPO_OWNER/SLUG when it is missing. The shallow-clone test now drops `origin` like Vercel does. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KqTAWD4QnKLcbMukj2phKQ
|
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Requested by Nathaniel · project thread
Before: Vercel's build clone has no
originremote (found in #4205), so everygit fetch … origin …inwebsite/scripts/vercel-ignore.shfailed silently. Previews whose fork point was past the ~10-commit clone ended inbuild — no base to compare, so PRs that don't touch the site still got preview builds.After: the script adds
originashttps://github.com/$VERCEL_GIT_REPO_OWNER/$VERCEL_GIT_REPO_SLUG.gitwhen it's missing, so the master fetch anddeepen()work and the existing fetch lines stay as they were.How: one guarded
git remote addafter thecdto the repo root (the clone is throwaway). The shallow-clone test cases now removeoriginlike Vercel does and map the GitHub URL to the local fixture withurl.<base>.insteadOf; they fail without the fix and pass with it.Verification on Vercel: this PR's preview log should show
vercel-ignore: build — preview changes vs master (base …): website/scripts/vercel-ignore.shinstead ofno base to compare.🤖 Generated with Claude Code
https://claude.ai/code/session_01KqTAWD4QnKLcbMukj2phKQ
Generated by Claude Code
Note
Low Risk
Changes only the Vercel docs skip/build gate; behavior still fails open to build when git history is unavailable.
Overview
Fixes preview builds firing on PRs that don't touch the docs site when Vercel's shallow clone has no
originremote, which caused allgit fetch … origin …calls (includingdeepen()) to fail and the script to fall through to build — no base to compare.After
cdto the repo root, the script now addsoriginashttps://github.com/$VERCEL_GIT_REPO_OWNER/$VERCEL_GIT_REPO_SLUG.gitwhen it's missing and those env vars are set, so existing master-fetch logic works without changing fetch commands.Tests for shallow clones remove
originlike Vercel, setVERCEL_GIT_*, and useurl.<local>.insteadOfso fetches hit the fixture repo; they exercise skip vs build when the fork is far behind master.Reviewed by Cursor Bugbot for commit 0170eb8. Bugbot is set up for automated code reviews on this repo. Configure here.