diff --git a/pipeline/backend/local/local.go b/pipeline/backend/local/local.go index 5cb8bb77c..3afc8c0d9 100644 --- a/pipeline/backend/local/local.go +++ b/pipeline/backend/local/local.go @@ -94,9 +94,17 @@ func (e *local) Exec(ctx context.Context, proc *types.Step) error { // Wait for the pipeline step to complete and returns // the completion results. func (e *local) Wait(context.Context, *types.Step) (*types.State, error) { + err := e.cmd.Wait() + ExitCode := 0 + if eerr, ok := err.(*exec.ExitError); ok { + ExitCode = eerr.ExitCode() + // Non-zero exit code is a build failure, but not an agent error. + err = nil + } return &types.State{ - Exited: true, - }, e.cmd.Wait() + Exited: true, + ExitCode: ExitCode, + }, err } // Tail the pipeline step logs.