Reputation: 10548
I have an Azure DevOps Pipeline that I want to only run when a specific tag is pushed to the repo, but for some reason it always runs on every commit.
My azure-pipelines.yml
has the trigger setup like this:
trigger:
tags:
include:
- mytag.*
I also tried excluding all branches:
trigger:
branches:
exclude:
- "*"
tags:
include:
- mytag.*
It seems like it makes no difference what the trigger
is set as, it just always runs on every commit.
How do I make it run only when I push a tag?
Upvotes: 2
Views: 6914
Reputation: 40543
I tried what you wrote and it seems to be working:
trigger:
branches:
exclude:
- '*'
tags:
include:
- v2.*
exclude:
- v2.0
pr:
branches:
include:
- refs/tags/v2.*
exclude:
- 'refs/tags/v2.0'
- '*'
So for this configuration when I make a commit, the build is not triggered. Only when I push a tag the build runs. It picks up last commit, but this this is clearly triggered by tag.
Here for instance you have another build which was triggered by Test commit
Upvotes: 6