I am working on such scenario:
main
.That configuration triggers the pipeline when I made the PR to main
:
name: CI-$(Date:dd.MM.yyyy)
trigger:
branches:
include:
- main
- develop
- release
pr:
branches:
include:
- main
pool:
name: $(agent)
# Rest of the code
When I remove main
keyword from trigger
section and keep the pr
section pipeline does not start after the PR is made to main
. Tried to review docs and other similar topic, but nothing found.
Also, when I commented all trigger
section and keep the pr
, made a commit I see the pipeline works. It shouldn't because it was just a commit, not a pr.
EDIT 1.
Based on the first reply, and above documentation, lets say I am going to create it according to that screenshot:
It means that I can remove completely the pr
section from my pipeline? And the rest should be untouched. Sorry for additional question, but I did it like on the attached screenshot from main
branch, than create a pr to main
and pipeline does not trigger (with removed pr
section and leave trigger
only). Of course before I pushed that pipeline to the main
branch, create the first pipeline based on provided .yml and run first time the new pipeline manually just to check if it works, and it does. Than test with pr
does not trigger the pipeline.
As per pr definition:
YAML PR triggers are supported only in GitHub and Bitbucket Cloud.
If you use Azure Repos Git, you can configure a branch policy for build validation to trigger your build pipeline for validation.