Suffix the command with || true to let the step continue past the failure, or || exit 0 to stop the script there while still reporting success. For the opposite behavior, do nothing: Jenkins fails the step on the first nonzero exit by default. The same idiom works inside sh steps in Declarative pipelines. Use it deliberately per command, not as a blanket set +e, so real failures still fail the build.

Context: Stack Overflow #14392349 (accepted answer, 181 votes): an execute-shell step runs git commit, which exits nonzero when there is nothing to commit, and Jenkins marks the whole build failed. The asker wants the build to survive that. The accepted answer gives the shell idiom for controlling step failure explicitly.