The latter (steps) gets a little ugly with the amount of nesting, but in the use case that I have an optional job I can work around this by redefining the entire workflow again, and include the extra job, but the permutations here could explode.
Use case - only publish asset when version is provided.
version: 2.1
parameters:
publish_target:
default: "" #empty values considered FALSEY
type: string
workflows:
basic:
jobs:
- sample_job:
name: Build It
- sample_job:
name: Share It
when: <<pipeline.parameters.publish_target>>
With current features we can use parameters to have conditional workflows and conditional steps
The latter (steps) gets a little ugly with the amount of nesting, but in the use case that I have an optional job I can work around this by redefining the entire workflow again, and include the extra job, but the permutations here could explode.
Use case - only publish asset when version is provided.