0
votes

I have multiple YAML build pipeline in Azure DevOps. If I commit something in one file my both build pipelines triggers by own. How can i set a condition that only committed build pipelines should trigger.

2
What are the triggers?Cid

2 Answers

1
votes

You can specify file paths to include or exclude in your pipelines. For example:

# specific path build
trigger:
  branches:
    include:
      - master
      - releases/*
  paths:
    include:
      - docs/*
    exclude:
      - docs/README.md

More information Here.

0
votes

When your pipelines are using the same Yaml file, the triggers in Yaml code may not meet your needs.

Since they use the same yaml file to create the pipeline, if you make changes for yaml file in one pipeline, the other pipelines will also apply the same changes. In this case, the commit could also trigger multiple build pipelines.

I would like to share a general method: you could control the triggers in UI trigger editor for each pipelines.

enter image description here

Here is an example:

enter image description here

The trigger setting in the UI editor will override the trigger in Yaml. You can set the corresponding trigger for each pipeline(even disable the trigger).

In the case of using the same yaml file, the UI editor can also set different conditions for the pipeline trigger.