Reputation: 2444
I am trying to create a Build definition in VSTS to run when Pull Requests are made. I have already set up a CI build for the master
branch but want to run a separate build on each PR before merging (ideally automatically) into master. I understand branch policies but am having trouble creating the actual Build definition.
When I try to configure the build the Get Sources
task requires a branch name, which I don't have when it comes to Pull Requests. How do I create a Build definition just for Pull Requests (where the branch name is unknown)?
Upvotes: 0
Views: 508
Reputation: 497
This is one of those things that 'just works' without you actually needing to think about it.
Upvotes: 1
Reputation: 59055
Use Branch Policies. That will allow you to reuse your existing CI build and have it automatically run as part of any PR opened against the specified branch.
Upvotes: 1