Skip to content

Commit

Permalink
Reorder task inputs
Browse files Browse the repository at this point in the history
  • Loading branch information
rhyskoedijk committed Nov 8, 2024
1 parent bbb7d76 commit 09f7f5a
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 16 deletions.
2 changes: 1 addition & 1 deletion task/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ async function run() {
buildSourcePath: getInputRequired('buildSourcePath'),
buildArtifactPath: getInputRequired('buildArtifactPath'),
buildFileList: getInput('buildFileList', false),
buildDockerImagesToScan: getInput('buildDockerImagesToScan', false),
manifestOutputPath: getInput('manifestOutputPath', false),
enableManifestGraphGeneration: getBoolInput('enableManifestGraphGeneration', false),
enablePackageMetadataParsing: getBoolInput('enablePackageMetadataParsing', false),
Expand All @@ -23,7 +24,6 @@ async function run() {
packageSupplier: getInputRequired('packageSupplier'),
packageNamespaceUriBase: getInput('packageNamespaceUriBase', false),
packageNamespaceUriUniquePart: getInput('packageNamespaceUriUniquePart', false),
dockerImagesToScan: getInput('dockerImagesToScan', false),
additionalComponentDetectorArgs: getInput('additionalComponentDetectorArgs', false),
externalDocumentReferenceListFile: getInput('externalDocumentReferenceListFile', false),
});
Expand Down
21 changes: 10 additions & 11 deletions task/task.json
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,15 @@
"helpMarkDown": "The list of file paths (one per line) for which the SBOM file will describe. If specified, this overrides `buildArtifactPath`, only files listed here will be included in the generated SBOM.",
"visibleRule": "command=generate"
},
{
"name": "buildDockerImagesToScan",
"type": "string",
"label": "Build Docker Images To Scan",
"defaultValue": "",
"required": false,
"helpMarkDown": "Comma separated list of docker image names or hashes to be scanned for package dependencies. For example, `ubuntu:16.04, 56bab49eef2ef07505f6a1b0d5bd3a601dfc3c76ad4460f24c91d6fa298369ab`.",
"visibleRule": "command=generate"
},
{
"name": "manifestOutputPath",
"type": "string",
Expand Down Expand Up @@ -183,16 +192,6 @@
"helpMarkDown": "A unique valid URI part that will be appended to the SBOM namespace URI. If specified, this value should be globally unique.",
"visibleRule": "command=generate"
},
{
"groupName": "advanced",
"name": "dockerImagesToScan",
"type": "string",
"label": "Docker Images To Scan",
"defaultValue": "",
"required": false,
"helpMarkDown": "Comma separated list of docker image names or hashes to be scanned for package dependencies. For example, `ubuntu:16.04, 56bab49eef2ef07505f6a1b0d5bd3a601dfc3c76ad4460f24c91d6fa298369ab`.",
"visibleRule": "command=generate"
},
{
"groupName": "advanced",
"name": "additionalComponentDetectorArgs",
Expand All @@ -219,4 +218,4 @@
"target": "index.js"
}
}
}
}
8 changes: 4 additions & 4 deletions task/utils/spdx/sbomTool.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ export interface SbomGenerateArgs {
buildSourcePath: string;
buildArtifactPath: string;
buildFileList?: string;
buildDockerImagesToScan?: string;
manifestOutputPath?: string;
enableManifestGraphGeneration?: boolean;
enablePackageMetadataParsing?: boolean;
Expand All @@ -27,7 +28,6 @@ export interface SbomGenerateArgs {
packageSupplier: string;
packageNamespaceUriBase?: string;
packageNamespaceUriUniquePart?: string;
dockerImagesToScan?: string;
additionalComponentDetectorArgs?: string;
externalDocumentReferenceListFile?: string;
}
Expand Down Expand Up @@ -59,6 +59,9 @@ export class SbomTool {
if (args.buildFileList) {
sbomToolArguments.push('-bl', await createTemporaryFileAsync('build-file-list', args.buildFileList));
}
if (args.buildDockerImagesToScan) {
sbomToolArguments.push('-di', args.buildDockerImagesToScan);
}
if (args.manifestOutputPath) {
sbomToolArguments.push('-m', args.manifestOutputPath);
}
Expand Down Expand Up @@ -86,9 +89,6 @@ export class SbomTool {
if (args.packageNamespaceUriUniquePart) {
sbomToolArguments.push('-nsu', args.packageNamespaceUriUniquePart);
}
if (args.dockerImagesToScan) {
sbomToolArguments.push('-di', args.dockerImagesToScan);
}
if (args.additionalComponentDetectorArgs) {
sbomToolArguments.push('-cd', args.additionalComponentDetectorArgs);
}
Expand Down

0 comments on commit 09f7f5a

Please sign in to comment.