Templates 我可以排除job';在azure devops中更改模板时执行?

Templates 我可以排除job';在azure devops中更改模板时执行?,templates,azure-devops,continuous-integration,azure-pipelines,azure-devops-pipelines,Templates,Azure Devops,Continuous Integration,Azure Pipelines,Azure Devops Pipelines,我正在使用一个模板构建一个管道(接下来将有更多管道使用相同的模板)。我的问题是,当我更改模板中的某些内容时,管道将被执行,这意味着当有更多管道使用该模板时,所有管道都将被执行 是否有任何迹象表明,当模板更改时,我不需要自动执行管道 这是我的模板: parameters: - name: repoName # name of the parameter; required type: string # data type of the parameter; required default

我正在使用一个模板构建一个管道(接下来将有更多管道使用相同的模板)。我的问题是,当我更改模板中的某些内容时,管道将被执行,这意味着当有更多管道使用该模板时,所有管道都将被执行

是否有任何迹象表明,当模板更改时,我不需要自动执行管道

这是我的模板:

parameters:
- name: repoName # name of the parameter; required
  type: string # data type of the parameter; required
  default: ''


jobs:
- job: BuildImage
  displayName: Build

  pool:
    name: Azure Pipelines
    demands: java  
    vmImage: ubuntu-20.04
    
  steps:
  - checkout: ${{ parameters.repoName }}
    clean: true
    fetchDepth: 1

  - task: Gradle@2
    displayName: 'gradlew clean'
    inputs:
      workingDirectory: ./
      tasks: clean
      publishJUnitResults: false
      jdkVersionOption: 1.11

  - task: Gradle@2
    displayName: 'gradlew build'
    inputs:
      options: '-x test'
      publishJUnitResults: false
      jdkVersionOption: 1.11

  ##Fix Jacoco
  - task: Gradle@2
    displayName: 'gradlew test'
    inputs:
      tasks: test
      publishJUnitResults: false
      codeCoverageToolOption: JaCoCo
      jdkVersionOption: 1.11

  ## Add Sonar 
在这里,模板正在使用它:

resources:
  repositories: 
  - repository: repository
    type: git
    name: CORE_tpaas-utilities
    ref: 'refs/heads/development'

extends:
  template: ../templates/ci.yml
  parameters: 
    repoName: repository

您可以对管道触发器使用路径筛选器。例如,将以下内容添加到管道yaml文件中

resources:
....

trigger: 
  paths:
    exclude:
    - path/to/template.yml

extends:
....
指定上述路径过滤器后,将排除管道触发器的模板yaml文件。对模板文件进行更改时,将不会执行管道


有关详细信息,请参阅。

您好,您是否尝试将路径筛选器添加到管道触发器。进展如何?