0
votes

I have multiple projects in my git repo on Azure DevOps. I have build pipelines setup to trigger when commit occurs on the "staging" branch (which is our Develop branch). But I added an additional trigger that I thought would filter on a sub-folder of the repo. Currently there are three pipelines all set to trigger on commit and sub-folder. And all three run even when there is a commit with files from only one of the target sub-folders. See the screen shot of one of my triggers:

enter image description here

Seems like the triggers are setup like an OR not an AND. So, in other words any commit to staging will trigger all three builds, but there are times when I don't want all three to build and publish. Just the one that I fixed should be built and published.

Is there any way to fix this?

1
I have create a sample to test this issue, it works fine on my side. How are your three file path filters set? Did you modify the file only in one of the filtering paths and not in the other? Can you share with us the specific settings of your three path filters? Is there any build completion for other pipelines?Leo Liu-MSFT
Yep, you made me look ;-) Each pipeline has both Branch and Path set. The path for each pipeline is different in that it is the sub-folder of the project that should be built in that pipeline.Ken Hadden
I can confirm this feature is fine. I have never receive any other member report this issue. This should be related to your project/pipeline settings. So, we need to double check some info about this issue, whether the three paths have inclusion relationships, like: Path1: /Source/A Path2: /Source/A/B. And if there is any branch policy for staging, share some images about them.Leo Liu-MSFT
@LeoLiu-MSFT I have left the issue alone. I do not want to convert to yaml builds since I do not have time to learn another tech. So for now it looks like two of my pipelines always trigger no matter what is checked in. And the third will trigger independently. So until I have some major down-time on development, I'm going to live with it.Ken Hadden

1 Answers

0
votes

You're right in that both Branch and Path apply. See here: https://docs.microsoft.com/en-us/azure/devops/pipelines/build/triggers?view=azure-devops&tabs=yaml#multiple-pipelines-triggered-on-the-same-repository

Consider migrating to yaml based builds, and set up each build in a different yaml file with it's own path triggers. Not only will this solve your issue, but you'll have the benefits of checked-in pipelines.