Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/fix-cli-team-id-repo-link.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@workflow/cli": patch
---

Fix CLI 401 errors by reading orgId from per-project entry in repo.json for newer Vercel CLI versions
14 changes: 12 additions & 2 deletions packages/cli/src/lib/inspect/vercel-link.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,13 @@ interface RepoProjectConfig {
id: string;
name: string;
directory: string;
/** Per-project orgId — added in vercel/vercel#14967. Prefer this over root-level orgId. */
orgId?: string;
}

interface RepoProjectsConfig {
orgId: string;
/** Legacy root-level orgId — older Vercel CLI versions put orgId here. */
orgId?: string;
remoteName: string;
Comment thread
TooTallNate marked this conversation as resolved.
projects: RepoProjectConfig[];
}
Expand Down Expand Up @@ -195,9 +198,16 @@ async function getProjectLinkFromRepoLink(
logger.debug(`Found matching repo projects: ${JSON.stringify(projects)}`);
if (projects.length === 1) {
const project = projects[0];
// Prefer per-project orgId (vercel/vercel#14967), fall back to
// root-level orgId for older Vercel CLI versions.
const orgId = project.orgId ?? repoLink.repoConfig?.orgId;
if (!orgId) {
logger.debug('No orgId found in repo link project or root config');
return null;
}
return {
repoRoot: repoLink.rootPath,
orgId: repoLink.repoConfig.orgId,
orgId,
projectId: project.id,
projectName: project.name,
projectRootDirectory: project.directory,
Comment thread
TooTallNate marked this conversation as resolved.
Expand Down