From 86ace37bca6eaff9e15f6498836bdc4646c57fa8 Mon Sep 17 00:00:00 2001 From: Chris Novakovic Date: Thu, 24 Nov 2022 16:29:48 +0000 Subject: [PATCH] `yarn audit` producer: unconditionally write results file (#145) The enricher always expects producers that run before it to output results files, even if the producer found no issues to report. This isn't the case with the `yarn audit` producer - a results file is only written if at least one issue was found. Write a results file regardless of how many issues were found by the producer. Fixes #144. --- producers/yarn_audit/main.go | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/producers/yarn_audit/main.go b/producers/yarn_audit/main.go index 7eb8964..fc1b27f 100644 --- a/producers/yarn_audit/main.go +++ b/producers/yarn_audit/main.go @@ -22,12 +22,10 @@ func main() { log.Fatal(err) } - if yarnReport.AuditAdvisories != nil { - if err := producers.WriteDraconOut( - "yarn-audit", - yarnReport.AuditAdvisories.AsIssues(), - ); err != nil { - log.Fatal(err) - } + if err := producers.WriteDraconOut( + "yarn-audit", + yarnReport.AuditAdvisories.AsIssues(), + ); err != nil { + log.Fatal(err) } }