[cli] Fix comments project scope in monorepos - #17231
Conversation
🦋 Changeset detectedLatest commit: 676fedf The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
🧪 Unit Test StrategyComparing: Strategy: Affected packages only ✅ Only testing packages that have been modified or depend on modified packages. Affected packages - 1 (2%)
Unaffected packages - 48 (98%)
Results
This comment is automatically generated based on the affected testing strategy |
📦 CLI Tarball ReadyThe Vercel CLI tarball for this PR is now available! Quick TestYou can test this PR's CLI directly by running: npx https://vercel-ppknj6pds.vercel.sh/tarballs/vercel.tgz --helpUse in vercel.jsonTo use this CLI version in your project builds, add to your {
"build": {
"env": {
"VERCEL_CLI_VERSION": "vercel@https://vercel-ppknj6pds.vercel.sh/tarballs/vercel.tgz"
}
}
}Python Runtime WheelA Python Workers WheelA This comment is automatically generated |
Summary
Fix
vercel comments --project <name>in monorepos.Problem
Given a monorepo with
.vercel/repo.jsonlinkingweb-apptoacme-team, while the CLI's current scope is a personal account:vercel comments --project web-app # Error: Project "web-app" was not found in team "personal-account".The workaround required passing both the team and branch explicitly:
After this change, local repo metadata resolves the project owner and confirms that the project belongs to the current checkout, so this command selects the correct team and current Git branch: