From 18e8c87dc5d3dff91b22fd894c37d0864333ed5d Mon Sep 17 00:00:00 2001 From: Ofek Atar Date: Wed, 17 Aug 2022 18:42:48 +0300 Subject: [PATCH] feat: pass remote-repo-url arg to snyk-iac-test --- src/cli/commands/test/iac/v2/index.ts | 2 ++ src/lib/iac/test/v2/scan/index.ts | 4 ++++ src/lib/iac/test/v2/types.ts | 1 + 3 files changed, 7 insertions(+) diff --git a/src/cli/commands/test/iac/v2/index.ts b/src/cli/commands/test/iac/v2/index.ts index 459e1f2d75..99e3e948d1 100644 --- a/src/cli/commands/test/iac/v2/index.ts +++ b/src/cli/commands/test/iac/v2/index.ts @@ -56,6 +56,7 @@ async function prepareTestConfig( const orgSettings = await getIacOrgSettings(org); const projectTags = parseTags(options); const targetName = getFlag(options, 'target-name'); + const remoteRepoUrl = getFlag(options, 'remote-repo-url'); const attributes = parseAttributes(options); @@ -71,6 +72,7 @@ async function prepareTestConfig( projectTags, targetReference: options['target-reference'], targetName, + remoteRepoUrl, }; } diff --git a/src/lib/iac/test/v2/scan/index.ts b/src/lib/iac/test/v2/scan/index.ts index 94917ee4ea..322eaa531f 100644 --- a/src/lib/iac/test/v2/scan/index.ts +++ b/src/lib/iac/test/v2/scan/index.ts @@ -133,6 +133,10 @@ function processFlags( flags.push('-target-name', options.targetName); } + if (options.remoteRepoUrl) { + flags.push('-remote-repo-url', options.remoteRepoUrl); + } + return flags; } diff --git a/src/lib/iac/test/v2/types.ts b/src/lib/iac/test/v2/types.ts index a24b052cab..1e67341de9 100644 --- a/src/lib/iac/test/v2/types.ts +++ b/src/lib/iac/test/v2/types.ts @@ -15,4 +15,5 @@ export interface TestConfig { projectTags?: Tag[]; targetReference?: string; targetName?: string; + remoteRepoUrl?: string; }