【发布时间】:2021-01-04 13:01:07
【问题描述】:
我正在尝试使用 azure devops 在拉取请求管道中动态设置组。 Yaml 文件如下所示:
variables:
- ${{ if eq(variables['System.PullRequest.TargetBranch'], 'refs/heads/dev') }}:
- group: dev-var-group
这不起作用并且条件被评估为“假”。只是为了确认它,我将条件颠倒如下
variables:
- ${{ if ne(variables['System.PullRequest.TargetBranch'], 'refs/heads/dev') }}:
- group: dev-var-group
在正确设置了哪个组并且读取了所有必需的变量并且管道工作之后。
任何人都可以在这里协助以使其在正确的条件下工作吗?
【问题讨论】:
标签: azure azure-devops yaml azure-yaml-pipelines