ci(format): fix checkout for fork PRs#5164
Merged
Merged
Conversation
The format job checked out github.head_ref without setting repository, so it defaulted to the base repo. For fork PRs the head branch only exists on the fork, making checkout fail with 'a branch or tag with the name <branch> could not be found' (e.g. PR #5099). Resolve repository to the head repo on pull_request events; same-repo PRs are unchanged, so the same-repo-guarded auto-format push-back still works.
Contributor
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
📣 Social Copy GeneratorGenerate social media copies (Twitter/X, LinkedIn, Blog Post) for this PR using Claude.
|
Contributor
|
Size Change: 0 B Total Size: 979 kB ℹ️ View Unchanged
|
tylerslaton
approved these changes
Jun 2, 2026
onsclom
marked this pull request as ready for review
June 2, 2026 18:10
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.
Problem
The
formatjob setsref: github.head_refbut leavesrepository:unset, so it checks the head branch out of the base repo. For fork PRs the head branch only exists on the fork, so checkout fails before formatting even runs.Seen on #5099 (fork PR, branch
fix/5072):Fix
Resolve
repositoryto the head repo on PRs, matchingref:Same-repo PRs are unchanged (head repo == base repo), so the auto-format push-back still works.