Reputation: 725
When I try to add below code to pipeline I got message "duplicate key" for buildVersion:
trigger: none
pool:
vmImage: 'windows-latest'
variables:
${{ if endsWith( variables['Build.SourceBranchName'], 'master' ) }}:
buildVersion: 'master'
${{ else }}:
buildVersion: 'none-master'
Do you have any idea how to fix it?
Upvotes: 2
Views: 970
Reputation: 14052
You code is fine, I've tested it and it works. The problem is the Pipeline editor. It doesn't seem to be able to parse the Conditional so it will give you squiggly lines and an error message but you can ignore it.
Upvotes: 4