I have 2 repos on Azure Devops, the second one was created as a fork of the first one. My team wants to create PRs from a branch from the original repo to the main branch on the fork, or using a source and target branch on the fork.
How can I create a build validation on my branch policies to build the source branch from the PR, depending on if it's from the original repo or from the fork? Having a single build validation won't work, because the build pipeline targets just one of the repos.
Any help will be appreciated.
Thanks!
From your description,
If you want to build source branch from PR on two repos, you can create two build validations, one is for original repo and another is for fork repo. Then check out multiple repositories in your yaml pipeline.
You can follow steps below:
1.Add two Build Validations.(one is for original repo and another is for fork repo)
2 Check out multiple repositories.
Test Result:
When a new PR from the original repo or from the fork repo is created or changes are pushed to an existing PR that targets the branch, the build will be triggered.
If there is any misunderstanding, please provide more information related to your issue.