Azure Pipeline – Publish Artifact task – need to publish Black Duck diagnostics file artifact

I have a Black Duck scan which is not working as advertised.
I contacted the Synposys people and they requested I enable diagnostics mode for the scan task and I provide the genrated zip file tothem for analysis.
But… the scan pipeline runs on VS 2022 Agent pool. What this means is that everything is deleted at the end of the pipeline run.
So, to get the actual file and move it to a safe location before the Docker container is destroyed and all data lost, I added a Publish Artifact task that would get the file and make a backup.
Only problem is, the name of the file contains a Timestamp.
For example:
detect-run-2023-12-14-05-24-41-962.zip -> yyyy-MM-dd-hh-mm-ss-SSS
In order to fix this, I was advised to set the Artifact name of the Publish Artifact task to <detect*.zip>
But this will make the task throw exception:
##[error]Artifact name is not valid: detect*.zip. It cannot contain ”, /’, “‘, ‘:’, ‘<‘, ‘>’, ‘|’, ‘*’, and ‘?’
Is it even possible to get that generated file name from some pipeline variable ?
Any reply is appreciated
Thank you

Leave a Comment