Multiple parraller trivy scans using the plugin fails
When I am using the plugin in our jenkins, I noticed that if 2 jobs are using the same machine and utility, they both create scan2html-temp-report.json in their TMP_DIR location, this caused my job to fail because it removed the json after the scan of the first job.
Optional solution solution for this will be to modify the name of the json to be a dynamic one once we are running the scan, I note that
func GetScan2htmlTempReportPath() string { return filepath.Join(os.TempDir(), "scan2html-temp-report.json") }
I saw this function in the internal/common dir.
Another solution that I did right now is to create a new dir in the TMP_DIR for each job I am running, but this will not use the caching that trivy provides
Hi @yarinlaniado ,
Thanks for opening the issue.
I have another suggestion, which would be appending a time stamp of the execution of the jobs to the temp file. So that each time we will have a unique file name.
Would you like to help us with this improvement?
func GetScan2htmlTempReportPath() string { return filepath.Join(os.TempDir(), "scan2html-temp-report-2025_10_21_11_04_05_06_567.json") }
I will try to contribute later this week