Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: include tags when creating #33

Merged
merged 1 commit into from
Jun 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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