Hi,
how can I check, if a variable exists in a condition? I want to run a step only, if a variable does not exists.
Thanks
Pascal
Hi,
how can I check, if a variable exists in a condition? I want to run a step only, if a variable does not exists.
Thanks
Pascal
Hello. When a variable does not exist at all, if you try to interpolate it will not expand at all.
So you can use the following code
run_optional_step:
title: Install dependencies
image: python:3.6.4-alpine3.6
commands:
- pip install .
when:
condition:
all:
whenMyVarisNotSet: 'includes("${{MY_VARIABLE}}", "MY_VARIABLE") == true'