小编Adn*_*man的帖子

动态设置自动管道的参数值

如果我创建一个参数,我可以在手动运行管道时设置其值。但是当管道自动运行时,它使用默认值。当管道自动运行时(例如响应推送到存储库)是否有任何方法可以向其传递参数值?

这是我正在使用的 yaml 文件。目标是能够控制在管道中运行哪些测试。

parameters:
  - name: testFiles
    type: string
    default: cypress/integration/first.spec.js

trigger:
  - azure-test

pool:
  vmImage: ubuntu-latest

steps:
  - task: NodeTool@0
    inputs:
      versionSpec: "10.x"
    displayName: "Install Node.js"

  - script: npm install
    displayName: "npm install"

  - script: npx cypress run --record --key [record key removed] --spec ${{ parameters.testFiles }}
    displayName: "run cypress"
Run Code Online (Sandbox Code Playgroud)

continuous-integration azure-devops azure-pipelines

6
推荐指数
1
解决办法
1万
查看次数