Skip to content

Commit

Permalink
fix: apply strip_refreshing to output for errors (runatlantis#4443)
Browse files Browse the repository at this point in the history
Co-authored-by: PePe Amengual <jose.amengual@gmail.com>
  • Loading branch information
2 people authored and Edvard Makhlin committed May 23, 2024
1 parent 18fc5f6 commit dce1010
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion server/core/runtime/run_step_runner.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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:
Expand Down

0 comments on commit dce1010

Please sign in to comment.