Add output path for scan results

This commit is contained in:
Justin Hutchings
2023-01-21 22:04:05 +00:00
parent faeef2efa9
commit a034b23040
2 changed files with 5 additions and 1 deletions

3
.gitignore vendored
View File

@@ -65,3 +65,6 @@ typings/
# next.js build output
.next
# Output from scanning
output.json

View File

@@ -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);
}