Add support for additional CLI parameters
This commit is contained in:
+11
-1
@@ -49,12 +49,22 @@ export default class ComponentDetection {
|
||||
core.info("Running component-detection");
|
||||
|
||||
try {
|
||||
await exec.exec(`${this.componentDetectionPath} scan --SourceDirectory ${path} --ManifestFile ${this.outputPath}`);
|
||||
await exec.exec(`${this.componentDetectionPath} scan --SourceDirectory ${path} --ManifestFile ${this.outputPath} ${this.getComponentDetectionParameters()}`);
|
||||
} catch (error: any) {
|
||||
core.error(error);
|
||||
}
|
||||
}
|
||||
|
||||
private static getComponentDetectionParameters(): string {
|
||||
var parameters = "";
|
||||
parameters += (core.getInput('directoryExclusionList')) ? ` --DirectoryExclusionList ${core.getInput('directoryExclusionList')}` : "";
|
||||
parameters += (core.getInput('ignoreDirectories')) ? ` --IgnoreDirectories ${core.getInput('ignoreDirectories')}` : "";
|
||||
parameters += (core.getInput('detectorArgs')) ? ` --DetectorArgs ${core.getInput('detectorArgs')}` : "";
|
||||
parameters += (core.getInput('detectorsFilter')) ? ` --DetectorsFilter ${core.getInput('detectorsFilter')}` : "";
|
||||
parameters += (core.getInput('dockerImagesToScan')) ? ` --DockerImagesToScan ${core.getInput('dockerImagesToScan')}` : "";
|
||||
return parameters;
|
||||
}
|
||||
|
||||
private static async getManifestsFromResults(): Promise<Manifest[]| undefined> {
|
||||
core.info("Getting manifests from results");
|
||||
// Parse the result file and add the packages to the package cache
|
||||
|
||||
Reference in New Issue
Block a user