I have the exact same pipeline in two different branches of the same repository, stage
and prod
.
I'd like the pipeline on branch stage
to run when a tag starting with stage@
is created (e.g. stage@1.0.1
); similarly, I'd like the pipeline on branch prod
to run when a tag starting with prod@
is created (e.g. prod@1.0.1
).
In branch stage
, trigger is defined like this:
# .azure-pipelines.yml [refs/branches/stage]
trigger:
tags:
include:
- stage@*
In branch prod
, trigger is defined like this:
# .azure-pipelines.yml [refs/branches/prod]
trigger:
tags:
include:
- prod@*
Now I created a pipeline on Azure DevOps named [Deploy to STAGE]
from the file in the stage
branch, and one named [Deploy to PROD]
from the file in the prod
branch.
I tried creating a tag:
$ git branch
master
prod
* stage
$ git tag -a stage@1.0.6 -m "stage@1.0.6"
$ git push --tags
I expected the [Deploy to STAGE]
pipeline to start, but both pipelines started instead:
Am I missing something? Isn't the trigger supposed to only include tags matching the defined pattern? How do I correct the trigger to achieve the described flow?