【发布时间】:2019-12-23 05:18:32
【问题描述】:
Azure Pipelines 有 Expressions 和 Conditions,但我找不到根据条件将两个值之一分配给 variable 的方法。
有什么方法可以完成这个伪代码的功能吗?
${{ if endsWith( variables['Build.SourceBranchName'], '/master' ) }}:
buildVersion: variables['mavenVersion']
${{ else }}:
buildVersion: variables['Build.SourceBranchName']
【问题讨论】:
-
现在你的 yaml 是有效的 :) docs.microsoft.com/en-us/azure/devops/release-notes/2021/…
标签: azure-devops yaml azure-pipelines