Skip to content

Commit 7c34e74

Browse files
author
Günter Schafranek
committed
feat: Dependency track tags reporting
- Allow providing (multiple) tags for dependency track reporting Signed-off-by: Günter Schafranek <[email protected]>
1 parent 837a023 commit 7c34e74

File tree

6 files changed

+16
-0
lines changed

6 files changed

+16
-0
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,7 @@ Options:
132132
--project-group Dependency track project group
133133
--project-name Dependency track project name. Default use the directory name
134134
--project-version Dependency track project version [string] [default: ""]
135+
--project-tag Dependency track project tag. Multiple values allowed. [array]
135136
--project-id Dependency track project id. Either provide the id or the project name and version tog
136137
ether [string]
137138
--parent-project-id Dependency track parent project id [string]

bin/cdxgen.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,9 @@ const args = _yargs
136136
default: "",
137137
type: "string",
138138
})
139+
.option("project-tag", {
140+
description: "Dependency track project tag. Multiple values allowed.",
141+
})
139142
.option("project-id", {
140143
description:
141144
"Dependency track project id. Either provide the id or the project name and version together",

docs/CLI.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ Options:
8181
--project-group Dependency track project group
8282
--project-name Dependency track project name. Default use the directory name
8383
--project-version Dependency track project version [string] [default: ""]
84+
--project-tag Dependency track project tags. Multiple values allowed. [array]
8485
--project-id Dependency track project id. Either provide the id or the project name and version tog
8586
ether [string]
8687
--parent-project-id Dependency track parent project id [string]

docs/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,8 @@ Invoke cdxgen with the below arguments to automatically submit the BOM to your o
133133
--project-name Dependency track project name. Default use the di
134134
rectory name
135135
--project-version Dependency track project version [default: ""]
136+
--project-tag Dependency track project tag. Multiple values all
137+
owed. [array]
136138
--project-id Dependency track project id. Either provide the i
137139
d or the project name and version together
138140
--parent-project-id Dependency track parent project id

lib/cli/index.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8677,6 +8677,14 @@ export async function submitBom(args, bomContents) {
86778677
) {
86788678
bomPayload.parentUUID = args.parentProjectId || args.parentUUID;
86798679
}
8680+
if (typeof args.projectTag !== "undefined") {
8681+
// If args.projectTag is not an array, convert it to an array
8682+
// Attention, array items should be of form { name: "tagName " }
8683+
// see https://yoursky.blue/documentation/rest-api#tag/bom/operation/UploadBomBase64Encoded
8684+
bomPayload.projectTags = (
8685+
Array.isArray(args.projectTag) ? args.projectTag : [args.projectTag]
8686+
).map((tag) => ({ name: tag }));
8687+
}
86808688
if (DEBUG_MODE) {
86818689
console.log(
86828690
"Submitting BOM to",

lib/server/server.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ const ALLOWED_PARAMS = [
3434
"projectId",
3535
"projectName",
3636
"projectGroup",
37+
"projectTag",
3738
"projectVersion",
3839
"parentUUID",
3940
"serverUrl",

0 commit comments

Comments
 (0)