0

I need some clarification wrt to Azure pipeline Git repo branch triggers. Following situation: In my develop branch I have a pipeline yml where the triggers are the develop and the main branch. The pipeline is initially created out of this yml file.

Now I create the main branch in my GIT repo but in the related yml file I remove the automatic triggering for the main branch since I want for the release builds to be triggered manually. Which trigger information is now used and applied in case a commit is pushed to main branch?

I know this scenario does not make so much sense but I am really wondering how a trigger can be defined that spans more than the current branch if in the other branch's yml file I can define in the yml again todally different triggers.

The question to be answered id: How is the trigger information resolved depending on the branch where the yml file is located?

The official docs mentioned here do answer this question: https://learn.microsoft.com/en-us/azure/devops/pipelines/repos/azure-repos-git?view=azure-devops&tabs=yaml#ci-triggers

NiharikaMoola-MT
  • 4,700
  • 1
  • 3
  • 15
Marko
  • 929
  • 9
  • 27
  • As far I understood it looks for trigger options from the file in current branch. So if you change trigger options for main branch on developer branch it actually doesn't affect main branch. Does this answer your question. – Krzysztof Madej Jun 24 '21 at 09:38
  • That definitely makes sense to me as well but if that is the case why can there be triggers specified at all for other than the current branch? The only explanation I have is that you want to implement once a yml file and if you branch of that main branch you do not want to change the original yml file just to specify a different trigger for the feature branch. – Marko Jun 24 '21 at 17:31
  • You could. On main/master branch you have triggers which apply to all specified options. However, if you change the options on other branch it will affect options for this branch. I mean if you have trigger set to branchA (master branch), and you remove that options but o branchB it will not take actually the place until you will mere branchB to master. But if you do the same change on branchB it should take place immediately. – Krzysztof Madej Jun 24 '21 at 20:40
  • Does that mean that in case on master branch there are triggers for master and develop then the pipeline of the master branch is triggered also for every change in the develop branch? At least I think I have not seen such a behaviour. – Marko Jun 25 '21 at 07:55
  • 1
    No it will fire only develop. – Krzysztof Madej Jun 25 '21 at 08:09

0 Answers0