I have three conditions as variables (isMaster, isRelease, isHotfix):
variables:
isMaster: $[startsWith(variables['Build.SourceBranch'], 'refs/heads/master')]
isRelease: $[startsWith(variables['Build.SourceBranch'], 'refs/heads/release/')]
isHotfix: $[startsWith(variables['Build.SourceBranch'], 'refs/heads/hotfix/')]
checkCondition: $[or(variables.isMaster, variables.isRelease)]
And the problem is when I take two 'false' for the OR condition (like checkCondition). I should get 'false' but for some reason I get 'true'.
- task: CmdLine@2
inputs:
script: |
echo %BUILD_SOURCEBRANCH%
echo %ISMASTER%
echo %ISRELEASE%
echo %ISHOTFIX%
echo %CHECKCONDITION%
condition: or(variables.isMaster ,variables.isRelease)
...
Result:
...
refs/heads/someBranch
False
False
False
True
Finishing: CmdLine
Anyone have an idea why the condition gives the wrong result? Thank You!
condition: or(variables.isRelease ,variables.isMaster)? It can make difference developercommunity.visualstudio.com/content/problem/1236160/… - Krzysztof Madejand(succeeded(), <your or condition>). - Mansoor