I created a variable called Test
in Pipeline UI and left the value as blank. So it appeared as shown below.
I'm trying to access this variable in YAML pipeline but unable to check it's empty value.
I'm trying like this :
- variables
- name: 'Release'
${{ if or(eq(variables['Test'],''), eq(variables['Test'], 'undefined')) }}:
value: 'Stage'
${{ if and(ne(variables['Test'],''), ne(variables['Test'], 'undefined')) }}:
value: 'Test'
The variable Release
value is always Stage
whether Test
variable is empty or any value in it.
I think there must be an easy way to check whether a variable value is empty or not?