Skip to content

Commit

Permalink
fix: add full file path to output file for iac scan
Browse files Browse the repository at this point in the history
  • Loading branch information
omerlh committed Jan 28, 2021
1 parent fb23890 commit 88f9d9a
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/lib/snyk-test/legacy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,7 @@ export interface BaseImageRemediationAdvice {
export interface TestResult extends LegacyVulnApiResult {
targetFile?: string;
projectName?: string;
targetFilePath?: string;
displayTargetFile?: string; // used for display only
foundProjectCount?: number;
}
Expand Down
2 changes: 2 additions & 0 deletions src/lib/snyk-test/run-iac-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import { projectTypeByFileType, IacFileTypes } from '../iac/constants';
export async function parseIacTestResult(
res: IacTestResponse,
targetFile: string | undefined,
targetFileRelativePath: string | undefined,
projectName: any,
severityThreshold?: SEVERITY,
//TODO(orka): future - return a proper type
Expand All @@ -38,6 +39,7 @@ export async function parseIacTestResult(
policy: meta.policy,
isPrivate: !meta.isPublic,
severityThreshold,
targetFilePath: targetFileRelativePath,
};
}

Expand Down
1 change: 1 addition & 0 deletions src/lib/snyk-test/run-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,7 @@ async function sendAndParseResults(
return await parseIacTestResult(
res,
iacScan.targetFile,
iacScan.targetFileRelativePath,
projectName,
options.severityThreshold,
);
Expand Down

0 comments on commit 88f9d9a

Please sign in to comment.