基于路径的作业条件

时间:2019-10-03 14:27:03

标签: azure azure-devops

是否可能有基于条件的条件,类似于Trigger?在我的管道中,我只想在特定文件夹已更改的情况下运行特定作业。

我已阅读本文档,但未找到参考文献

Pipeline Expressions

Pipeline Conditions

1 个答案:

答案 0 :(得分:0)

您可以在构建而不是工作上使用基于路径的触发器。

trigger:
  paths:
    include: [ string ] # file paths which must match to trigger a build
    exclude: [ string ] # file paths which will not trigger a build

从技术上讲,有一个Build.Reason自动变量,可以在构建队列时用来确定该变量,但是我认为您只需让路径触发器起作用即可

https://docs.microsoft.com/en-us/azure/devops/pipelines/build/variables?view=azure-devops&tabs=yaml#build-variables