-
-
Notifications
You must be signed in to change notification settings - Fork 6
Open
Description
Problem
When running mvb in a GitHub Actions workflow triggered by a PR from a fork, the build fails because mvb tries to checkout the PR's branch name in the upstream repo.
Error
@lando/mvb running command 'git' [ 'checkout', '53-ruby-4.0', '--force' ] from '/tmp/...'
@lando/mvb stderr error: pathspec '53-ruby-4.0' did not match any file(s) known to git
Cause
mvb clones the upstream repo to a temp directory, then tries to checkout the branch by name. For fork PRs, the branch (e.g., 53-ruby-4.0) only exists in the contributor's fork, not in the upstream repo.
Reproduction
- Contributor opens PR from their fork (e.g.,
contributor/repo→lando/repo) - GHA workflow runs
npx mvb docs - mvb clones
lando/repoand triesgit checkout <fork-branch-name> - Fails because that branch doesn't exist in
lando/repo
Example
- PR: Support Ruby 4.0 and mark 3.1 as legacy ruby#54
- Failed run: https://github.com/lando/ruby/actions/runs/21226013103
Suggested Fix
For fork PRs, mvb should either:
- Clone the fork's repo URL instead of upstream
- Use the PR merge ref (
refs/pull/N/merge) instead of branch name - Detect fork PRs and skip the dev branch checkout
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels