有条件地在 azure 管道中使用变量组

Mar*_*rko 3 azure-devops azure-pipelines azure-pipelines-yaml

我知道可以在 azure pipelines yml 中有条件地设置变量。请参阅https://learn.microsoft.com/en-us/azure/devops/pipelines/process/expressions?view=azure-devops#conditional-insertion

是否也可以有条件地使用变量组?

假设如果管道运行变量已设置或具有特定值,则管道应使用变量组。如果不是,则不得使用该组。

谢谢

Krz*_*tof 5

是否有可能像这里一样:

trigger: none
pr: none

variables:
  isProd: true

stages:
- stage: Test
  displayName: Build and restore
  variables:
  - ${{ if eq(variables['isProd'], 'false') }}:
    - group: QA
  - ${{ if eq(variables['isProd'], 'true') }}:
    - group: PROD
  jobs:
  - job: A
    steps:
    - bash: echo $(name)
Run Code Online (Sandbox Code Playgroud)