I am trying to set group dynamically in a pull request pipeline using azure devops. Yaml file looks like as below:
variables:
- ${{ if eq(variables['System.PullRequest.TargetBranch'], 'refs/heads/dev') }}:
- group: dev-var-group
This does not work and condition is evaluated to 'false'. Just to confirm it I reversed the condition as below
variables:
- ${{ if ne(variables['System.PullRequest.TargetBranch'], 'refs/heads/dev') }}:
- group: dev-var-group
After which group was set correctly and all the required variables are read and pipeline works.
Can anyone please assist here to get this working with the correct condition ?