From 967a535bb090a6db3a4ab80c28911ef1af06bece Mon Sep 17 00:00:00 2001 From: Xavier Rakotomamonjy Date: Mon, 17 Jun 2024 15:02:56 +0200 Subject: [PATCH] fix(exit-code): catch exit code In some case, the program exit with error and exit code of zero. Change this to exit with non zero code each time the list of error is not empty. --- main.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/main.go b/main.go index b0489f5..4d745c1 100644 --- a/main.go +++ b/main.go @@ -37,5 +37,9 @@ func main() { fmt.Fprintf(os.Stderr, "[helm-sops] Error: %s\n", err) } + if len(w.Errors) > 0 { + w.ExitCode = 1 + } + os.Exit(w.ExitCode) }