【发布时间】:2019-12-23 14:25:15
【问题描述】:
在 Azure 管道中,我使用 Build.SourceVersionMessage 变量来获取最后的提交消息。基于此,我想决定是否构建 docker 镜像(如果提交消息包含 'BUILD-DOCKER' 然后构建 docker 镜像):
...
- task: Docker@0
condition: and(succeeded(), contains(variables['Build.SourceVersionMessage'], 'BUILD-DOCKER'))
...
问题是在管道执行期间提交消息为空:
Evaluating: and(succeeded(), contains(variables['Build.SourceVersionMessage'], 'BUILD-DOCKER'))
Expanded: and(True, contains(Null, 'BUILD-DOCKER'))
Result: False
知道为什么它是空的吗?
另外,例如变量Build.SourceBranch 已正确解析
【问题讨论】:
-
你使用 Git 还是 TFVC?如果 git - Azure 存储库? GitHub?
-
Git - Azure 回购
-
在我这边,它工作得很好:/你能检查它在其他管道中是否也为空吗?
标签: azure azure-devops azure-pipelines