I have pipeline for some backend app for example , I would like to create trigger that run the pipeline whenever pull request is created ( before the approve and merge ) but not only for the main/master branch , also for any branches
for example if I'm create pull request from branch side branch "abc" to side branch "xyz" the pipeline will be triggered and run .
also if in the feature I will create branch with the name "foobar" and create pull request to some other side branch the pipeline will be created .
how can I achieve that ?
CodePudding user response:
You can do that with pr
triggers. You can include which branches do you want to trigger a build. In the below example when you create a pull request for current branch the pipeline will run. You can also use regex syntax like feature/*
trigger:
pr:
branches:
include:
- current
- xyz
exclude:
- uat
2, Add a build validation policy for all of the branches.