Rule will not trigger if the first of several optional variables is defined but not set
In the following job configuration, if either $VAR1 or $VAR2 are not empty or null, the script should run. However, if $VAR1 is empty in a pipeline schedule and $VAR2 has a value, the job will not run.
stages:
- test
test:
rules:
- if: $VAR1 || $VAR2
script: echo $VAR1 $VAR2
However, if the rule is expanded to ($VAR1 != null && $VAR1 != "") || ($VAR2 != null && $VAR2 != "")
then the job will run.
Edited by Kyle Harr