My aim is to have a template file which also defines the triggers. I have lots of very similar pipelines and i would like to also predefine the branches on which they are triggered. My Problem is it still runs for all branches and not only the ones as defined in triggers of template. here a very simplified exmaple of the issue:
assume template.yml in git template_repo:
trigger:
branches:
include:
- dev
- main
steps:
- script:|
echo "I only run on dev and main but i do not :("
then in main yaml azure-pipelines.yml i want to extend from this like this:
resources:
repositories:
- repository: template_repo
type: git
name: template/template_repo
extends:
template: template.yml@template_repo
The problem is now that this pipeline from azure-pipelines.yml is also triggered on feature_xyz branch…not only on main and dev.
A workaround is to copy/past trigger from template.yml into all my azure-pipelines.yml files, but i would like to know if it just does not work with extend or if i am doing something wrong.
So i hope good old stack overflow can help since GPT seems to lie :D….