Skip to content
This repository has been archived by the owner on Oct 17, 2024. It is now read-only.

Commit

Permalink
yarn audit producer: unconditionally write results file (#145)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
chrisnovakovic authored Nov 24, 2022
1 parent 4bda51f commit 86ace37
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions producers/yarn_audit/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
}

0 comments on commit 86ace37

Please sign in to comment.