Overview
You are trying to run a specific step only if a variable is set. You are trying to have branching logic in one pipeline.
Details
-
Using the following syntax, you can check whether a variable exists for the current build:
when: condition: all: whenVarIsMissing: 'includes("${{MyVar}}", "{{MyVar}}") == true'
-
The following syntax can be used to check for a specific value:
when: condition: all: whenVarValue: '"${{MyVar}}" == myValue"'
-
If desired, you can combine multiple checks.