From dce10106d5af313ecf118bef88a209ec34b5cc9a Mon Sep 17 00:00:00 2001 From: Ross Strickland Date: Tue, 21 May 2024 10:32:20 -1000 Subject: [PATCH] fix: apply strip_refreshing to output for errors (#4443) Co-authored-by: PePe Amengual --- server/core/runtime/run_step_runner.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/server/core/runtime/run_step_runner.go b/server/core/runtime/run_step_runner.go index 70d084506a..1e3335762c 100644 --- a/server/core/runtime/run_step_runner.go +++ b/server/core/runtime/run_step_runner.go @@ -71,6 +71,11 @@ func (r *RunStepRunner) Run(ctx command.ProjectContext, command string, path str runner := models.NewShellCommandRunner(command, finalEnvVars, path, streamOutput, r.ProjectCmdOutputHandler) output, err := runner.Run(ctx) + if postProcessOutput == valid.PostProcessRunOutputStripRefreshing { + output = StripRefreshingFromPlanOutput(output, tfVersion) + + } + if err != nil { err = fmt.Errorf("%s: running %q in %q: \n%s", err, command, path, output) if !ctx.CustomPolicyCheck { @@ -84,7 +89,7 @@ func (r *RunStepRunner) Run(ctx command.ProjectContext, command string, path str case valid.PostProcessRunOutputHide: return "", nil case valid.PostProcessRunOutputStripRefreshing: - return StripRefreshingFromPlanOutput(output, tfVersion), nil + return output, nil case valid.PostProcessRunOutputShow: return output, nil default: