Skip to content

Commit

Permalink
feat: include tags when creating
Browse files Browse the repository at this point in the history
Refs: 29

Signed-off-by: JCHacking <[email protected]>
  • Loading branch information
JCHacking committed Jun 18, 2024
1 parent 1f05267 commit 306d55c
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 0 deletions.
17 changes: 17 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@ Defaults to `https`

**Required, unless project is provided** Project version in Dependency-Track

### `projectTags`

Project tags in Dependency-Track

### `autoCreate`

Automatically create project and version in Dependency-Track, default `false`
Expand Down Expand Up @@ -68,6 +72,19 @@ with:
autoCreate: true
```

With project name, version and tags:
```
uses: DependencyTrack/[email protected]
with:
serverHostname: 'example.com'
apiKey: ${{ secrets.DEPENDENCYTRACK_APIKEY }}
projectName: 'Example Project'
projectVersion: 'master'
projectTags: 'tag1,tag2'
bomFilename: "/path/to/bom.xml"
autoCreate: true
```

With protocol, port and project name:
```
- name: SBOM zu DependencyTrack senden
Expand Down
4 changes: 4 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ inputs:
projectversion:
description: 'Project version in Dependency-Track'
required: false
projecttags:
description: 'Project tags in Dependency-Track'
default: ''
required: false
autocreate:
description: "Automatically create the project in Dependency-Track if it doesn't exist"
default: 'false'
Expand Down
2 changes: 2 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ try {
const project = core.getInput('project');
const projectName = core.getInput('projectname');
const projectVersion = core.getInput('projectversion');
const projectTags = core.getInput('projecttags').split(',').map(tag => tag.trim());
const autoCreate = core.getInput('autocreate') !== 'false';
const bomFilename = core.getInput('bomfilename');
const parent = core.getInput('parent');
Expand Down Expand Up @@ -50,6 +51,7 @@ try {
bomPayload = {
projectName: projectName,
projectVersion: projectVersion,
projectTags: projectTags.map(tag => ({name: tag})),
autoCreate: autoCreate,
bom: encodedBomContents
}
Expand Down

0 comments on commit 306d55c

Please sign in to comment.