Is there a way to create a branch pipeline trigger that does not trigger when a TAG is created? I want that all commits to the master branch trigger the pipeline, but i'm also using TAGs to trigger Nuget packaging! and I don't want these mixed up...
1
votes
2 Answers
2
votes
Yes. It would be to use the exclude
on the trigger under tags:
resources:
repositories:
- repository: string # identifier (A-Z, a-z, 0-9, and underscore)
type: enum # see the following "Type" topic
name: string # repository name (format depends on `type`)
ref: string # ref name to use; defaults to 'refs/heads/master'
endpoint: string # name of the service connection to use (for types that aren't Azure Repos)
trigger: # CI trigger for this repository, no CI trigger if skipped (only works for Azure Repos)
branches:
include: [ string ] # branch names which will trigger a build
exclude: [ string ] # branch names which will not
tags:
include: [ string ] # tag names which will trigger a build
exclude: [ string ] # tag names which will not
paths:
include: [ string ] # file paths which must match to trigger a build
exclude: [ string ] # file paths which will not trigger a build
Taken from YAML schema documentation
1
votes
Is there a way to create a branch pipeline trigger that does not trigger when a TAG is created?
The answer is yes, we could use the Push trigger with exclude
clause for branch and tag trigger.
trigger:
branches:
include:
- master
tags:
exclude:
- TAG
Note:
- If you specify an
exclude
clause without aninclude
clause forbranches
,tags
, orpaths
, it is equivalent to specifying*
in theinclude
clause. - To exclude multiple tags about TAG, we could use Wildcard with tag, like
TAG**
.