0
votes

I want to create azure pipeline trigger for pushes only. Currently I have trigger set for new all branches excluding dev and master. I want to avoid trigger when new branch is created but trigger on pushes to all branches except dev and master.

My pipeline trigger in yml currently is:

trigger:
  branches:
    include:
      - '*'
    exclude:
      - dev
      - master
1

1 Answers

0
votes

For your issue, I am afraid we could not achieve this at this moment. That because this is the current Azure Devops default design behavior, all files and paths in this branch are "new", which is also seen as a new change.

The reason for the current behavior is that whenever a new branch is created, all the files and paths in that branch are “new” and hence would satisfy each of the path conditions. We do not have the logic yet to figure out whether there are changes in the new branch relative to the parent branch from which it was created.

You could add your request for this feature on our UserVoice site, which is our main forum for product suggestions. You can comment and vote it there to increase priority.

Here are some cases with the similar issue, you can refer to these:Prevent "Create a new Branch" from triggering a build; Build Definition Triggers when I create a new branch