azuredevops icon indicating copy to clipboard operation
azuredevops copied to clipboard

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

Open emboss64 opened this issue 1 year ago • 10 comments

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

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)

emboss64 avatar Feb 24 '23 17:02 emboss64