Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Azure Pipeline trigger on tags

Tags:

azure-devops

I am making two pipelines. One will trigger on PR on Dev and Master branch. The another only trigger with new tags: So for the first one, I have trigger:

pr:
  - master
  - dev

And the second one:

trigger:
  tags:
    include:
    - '*'
    exclude:
    - master
    - dev

But the result is I have both triggered with PRs and the second first one is also triggered on CI. I have check there is no YAML overwrite on classic view. Any help is appreciated

like image 970
Adam Cheng Avatar asked Jun 04 '20 18:06

Adam Cheng


1 Answers

Azure Pipeline trigger on tags

If you want the second pipeline only trigger with new tags, you should set the parameter branches to exclude master and dev branch trigger.

So, the syntax should be like:

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

Please check this document for some more details.

Hope this helps.

like image 166
Leo Liu-MSFT Avatar answered Oct 08 '22 20:10

Leo Liu-MSFT