@@ -75,6 +75,7 @@ interface ScanCreateFlags {
7575 reportLevel : REPORT_LEVEL
7676 setAsAlertsPage : boolean
7777 tmp : boolean
78+ workspace : string
7879}
7980
8081export const CMD_NAME = 'create'
@@ -190,6 +191,12 @@ const generalFlags: MeowFlags = {
190191 'Set the visibility (true/false) of the scan in your dashboard.' ,
191192 shortFlag : 't' ,
192193 } ,
194+ workspace : {
195+ type : 'string' ,
196+ default : '' ,
197+ description :
198+ 'The workspace in the Socket Organization that the repository is in to associate with the full scan.' ,
199+ } ,
193200}
194201
195202export const cmdScanCreate = {
@@ -320,6 +327,7 @@ async function run(
320327 branch : branchName ,
321328 repo : repoName ,
322329 report,
330+ workspace,
323331 } = cli . flags as unknown as ScanCreateFlags
324332
325333 let { 0 : orgSlug } = await determineOrgSlug (
@@ -364,6 +372,10 @@ async function run(
364372 repoName = await getRepoName ( cwd )
365373 }
366374 }
375+ if ( ! workspace && sockJson . defaults ?. scan ?. create ?. workspace ) {
376+ workspace = sockJson . defaults . scan . create . workspace
377+ logger . info ( `Using default --workspace from ${ SOCKET_JSON } :` , workspace )
378+ }
367379 if ( typeof report !== 'boolean' ) {
368380 if ( sockJson . defaults ?. scan ?. create ?. report !== undefined ) {
369381 report = sockJson . defaults . scan . create . report
@@ -656,5 +668,6 @@ async function run(
656668 reportLevel,
657669 targets,
658670 tmp : Boolean ( tmp ) ,
671+ workspace : ( workspace && String ( workspace ) ) || '' ,
659672 } )
660673}
0 commit comments