From b891f61c936ea0d1556d7c1962863b48e62addf9 Mon Sep 17 00:00:00 2001 From: Andrea Waltlova Date: Fri, 1 Dec 2023 08:45:51 +0100 Subject: [PATCH] When script fails with exit code 1 we want to see the reson in logs Use case: problem in covnersion script when script exited with 1 but we had to manually reproduce the situation to see which part of code was problematic Signed-off-by: Andrea Waltlova --- src/runner.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/runner.go b/src/runner.go index dfdc5e0..6e3b181 100644 --- a/src/runner.go +++ b/src/runner.go @@ -127,9 +127,10 @@ func processSignedScript(incomingContent []byte) string { cmd := exec.Command(yamlContent.Vars.Interpreter, scriptFileName) //nolint:gosec setEnvVariablesForCommand(cmd, yamlContent.Vars.ContentVars) - out, err := cmd.Output() + out, err := cmd.CombinedOutput() if err != nil { log.Errorln("Failed to execute script: ", err) + log.Errorln(out) return "" }