Skip to content

Commit c72bfdd

Browse files
committed
fix(scan): flatten SDK options and make repo parameter conditional
Fixes regression where SDK call was using old nested queryParams structure. The SDK now expects flat options object per CreateFullScanOptions type. Also makes repo parameter conditional - only includes when repoName is truthy, fixing "Repo slug is required" errors when repoName is empty.
1 parent eaaf859 commit c72bfdd

File tree

1 file changed

+9
-11
lines changed

1 file changed

+9
-11
lines changed

packages/cli/src/commands/scan/fetch-create-org-full-scan.mts

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -57,17 +57,15 @@ export async function fetchCreateOrgFullScan(
5757
return await handleApiCall(
5858
sockSdk.createFullScan(orgSlug, packagePaths, {
5959
pathsRelativeTo: cwd,
60-
queryParams: {
61-
...(branchName ? { branch: branchName } : {}),
62-
...(commitHash ? { commit_hash: commitHash } : {}),
63-
...(commitMessage ? { commit_message: commitMessage } : {}),
64-
...(committers ? { committers } : {}),
65-
make_default_branch: String(defaultBranch),
66-
...(pullRequest ? { pull_request: String(pullRequest) } : {}),
67-
repo: repoName,
68-
set_as_pending_head: String(pendingHead),
69-
tmp: String(tmp),
70-
},
60+
...(branchName ? { branch: branchName } : {}),
61+
...(commitHash ? { commit_hash: commitHash } : {}),
62+
...(commitMessage ? { commit_message: commitMessage } : {}),
63+
...(committers ? { committers } : {}),
64+
make_default_branch: String(defaultBranch),
65+
...(pullRequest ? { pull_request: String(pullRequest) } : {}),
66+
...(repoName ? { repo: repoName } : {}),
67+
set_as_pending_head: String(pendingHead),
68+
tmp: String(tmp),
7169
}),
7270
{
7371
description: 'to create a scan',

0 commit comments

Comments
 (0)