From a034b2304025b7f100fdcb3714436ca20150b06d Mon Sep 17 00:00:00 2001 From: Justin Hutchings Date: Sat, 21 Jan 2023 22:04:05 +0000 Subject: [PATCH] Add output path for scan results --- .gitignore | 3 +++ componentDetection.ts | 3 ++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 7e874de..aa59238 100644 --- a/.gitignore +++ b/.gitignore @@ -65,3 +65,6 @@ typings/ # next.js build output .next + +# Output from scanning +output.json \ No newline at end of file diff --git a/componentDetection.ts b/componentDetection.ts index 35f207a..481bccb 100644 --- a/componentDetection.ts +++ b/componentDetection.ts @@ -9,6 +9,7 @@ dotenv.config(); import * as exec from '@actions/exec'; export const componentDetectionPath = './component-detection'; +const outputPath = './output.json'; // Get the latest release from the component-detection repo, download the tarball, and extract it export async function downloadLatestRelease() { try { @@ -32,7 +33,7 @@ export async function downloadLatestRelease() { // Run the component-detection CLI on the path specified export async function runComponentDetection(path: string) { try { - await exec.exec(`${componentDetectionPath} scan --SourceDirectory ${path}`); + await exec.exec(`${componentDetectionPath} scan --SourceDirectory ${path} --ManifestFile ${outputPath}`); } catch (error: any) { core.error(error); }