【问题标题】:How to read variable as a Number in Azure DevOps Pipelines?如何在 Azure DevOps Pipelines 中将变量读取为数字?
【发布时间】:2022-07-20 08:54:15
【问题描述】:

我有一个 Azure DevOps 构建管道 YAML 文件,它从“变量”按钮获取变量,而不是在 YAML 文件本身中包含“变量:”。

我正在尝试将数字传递给需要数字作为参数的步骤,但是管道无法运行,因为它说该值不是有效的数字。

在“变量”按钮内,我有变量 VersionId 和给定值 12345

extends:
  template: Directory/To/The/Template.yaml@Name
  parameters:
    projectVersionId: $(VersionId)

有没有一种方法可以明确说明这是一个数字,而不是一个字符串?

我尝试过同时使用${{variables.VersionId}}$[variables.VersionId]

【问题讨论】:

    标签: azure azure-devops yaml azure-pipelines azure-pipelines-yaml


    【解决方案1】:

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-10-27
      • 2021-01-05
      • 2021-02-10
      • 1970-01-01
      • 1970-01-01
      • 2020-06-09
      相关资源
      最近更新 更多