I create simple Azure DevOps Pipelines which should start for those specific branches:
trigger:
branches:
include:
- main
- develop
- release
pool:
name: $(agent)
# Rest of the code
I pushed that pipeline from develop branch and it starts executing. When I switched to the hotfix/test branch, and pushed the commit again, no pipeline was triggered. So I add above pipeline to hotfix/test again, now it works. The same with release I did, so now I have the same pipeline in three different branches. At the end I want to push my changes to main branch, and my assumption was that it will be working for all above branches and commits respectively.
In Pipeline settings I have set develop as default branch:
I am not sure if it is a default Azure DevOps Pipelines behavior or mine misunderstanding. However I want to have that pipeline in main branch and see that it works for commits pushed from those branches.
I create simple Azure DevOps Pipelines which should start for those specific branches:
trigger:
branches:
include:
- main
- develop
- release
pool:
name: $(agent)
# Rest of the code
I pushed that pipeline from develop branch and it starts executing. When I switched to the hotfix/test branch, and pushed the commit again, no pipeline was triggered. So I add above pipeline to hotfix/test again, now it works. The same with release I did, so now I have the same pipeline in three different branches. At the end I want to push my changes to main branch, and my assumption was that it will be working for all above branches and commits respectively.
In Pipeline settings I have set develop as default branch:
I am not sure if it is a default Azure DevOps Pipelines behavior or mine misunderstanding. However I want to have that pipeline in main branch and see that it works for commits pushed from those branches.
As mentioned in the comments, YAML pipeline file (and correspondent templates) must exist in the branches specified in the trigger.
I suggest you do the following when adding a new YAML pipeline:
trigger configuration for the other branches such as dev, releases/*, hotfix/*, etcmain or master)dev) cherry-pick changes from the pull request containing the pipeline
XXXyou must have them in that branch. – Rui Jarimba Commented Jan 2 at 19:52hotfix/testandhotfix/test2match the expressionhotfix/*so you have nothing to worry about, as long as the YAML pipeline and corresponding template(s) are stored in thehotfix/xxxxxxbranches. – Rui Jarimba Commented Jan 2 at 19:55