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

capture exit code for sarif #576

Merged
merged 1 commit into from
Nov 27, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions cmd/commands/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,10 @@ func runAudit(auditable ...kubeaudit.Auditable) func(cmd *cobra.Command, args []
log.WithError(err).Fatal("Error generating the SARIF output")
}
sarifReport.PrettyWrite(os.Stdout)

if report.HasErrors() {
os.Exit(rootConfig.exitCode)
}
return
case "json":
printOptions = append(printOptions, kubeaudit.WithFormatter(&log.JSONFormatter{}))
Expand Down
Loading