dependency-check / dependency-check/azuredevops

Unable to upload artifact of multiple task executions with multiple report formats

Open
#124 10 comments 1 reaction 1 assignee Claimed by @pippolino View on GitHub
enhancement
Dominant language
TypeScript
Stars
53
Forks
35
PR merge metrics
No merged PRs in 30d

Description

When you run `dependency-check-build-task` multiple times within the same pipeline your artifact only stores the files from the last run.
This wouldn't be an issue if you were only using a single output format and using `reportFilename`, which is not our case as we need both JUnit and HTML reports.

As a workaround, we are uploading artifacts after every run modifying the filename, but this results in also having the original filename
````
write-Host "##vso[task.addattachment type=dependencycheck-artifact;name=$new_name;]$new_path"
write-Host "##vso[artifact.upload containerfolder=dependency-check;artifactname=Dependency Check;]$new_path"
````
![image](https://user-images.githubusercontent.com/110336652/221248387-a1d27a2a-3a69-45c1-abef-a30398d0cb2e.png)

Some options I can think of to fix this:
- Allowing to override the `containerfolder` or `artifactname` with an extra parameter in: https://github.com/dependency-check/azuredevops/blob/c4e46d015524bc5ce61361813c118076f7a8e13b/src/Tasks/dependency-check-build-task/dependency-check-build-task.ts#L218
- Keep the same `containerfolder` and `artifactname` but allow prefixes or suffixes for artifact filenames.
- Flag to disable artifact upload (and then manually uploading files/artifacts via traditional methods if needed)

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.