I have a .yaml file
variables:
- name: command1
value: none
- scripts: |
echo '##vso[task.setvariable variable=command1]new_value'
- ${{ if ne(variables['command1'], 'none') }}:
- template: templates/run.yml@temp1 # Template reference
parameters:
COMMAND: '$(command1)'
I have created the variable for two reason ,
- to be global
- I dont want it to be displayed in the variable list for the users
I want the template only to be executed if variable value of 'command1'
is not 'none'
Currently it is not skipping , it keeps executing it even if the value inside the variable is not none.
The other if conditions format I have used is
- ${{ if ne(variables['taskName.command1'], 'none') }}:
- ${{ if ne('$(command1)', 'none') }}:
None of the above worked
Please help in resolving this issue.