This is a follow up to Should a pipeline fail if early termination is desired?. In that question, I'm asking about best practices and whether this request is sound. In this, I just need to know how best to get it done.
Normally a pipeline breaks down into stages such that each stage has one or more jobs. In order to stop the pipeline from running conditionally, you simply fail that stage of the pipeline.
For example let's assume I have a pipeline with four stages,
[Build] -> [Test] -> [Version Bump] -> [Publish]
Now, let's assume the
Version Bump may or may not bump the version number. Is there a way to have the
Version Bump pass regardless of whether the number was bumped, and to have Publish run conditionally if the version was bumped?