Search code examples
azureazure-devopsazure-pipelinesazure-yaml-pipelines

Azure DevOps Build Validation from Pipeline in another repository


I have 2 Repositories

  1. Repo A: Application Code Repo
  2. Repo B: DevOps Repo

All the build and release pipelines are in Repo B.

I am trying to achieve here is Build validation

So whenever I raise a PR from feature branch to master branch of Repo A that time Build validation pipeline which is in Repo B will trigger and pass the check (Which I am defining in branch policy).

It's working fine in same repo but with two repositories I am not getting any solution also I have 3 branch in Repo A and I have to implement for all the three branches.


Solution

  • So, whenever I raise a PR from feature branch to master branch of Repo A that time Build validation pipeline which is in Repo B will trigger and pass the check (Which I am defining in branch policy).

    I tested the issue, and it works when the Repo A and Repo B is in the same project.

    My test:

    1. Repo A and Repo B is in the same project.
    2. Create a pipeline named build and release pipelines in Repo B a pipeline in Repo B
    3. Set Build validation branch policy with the pipeline in Repo B for main branch of Repo A Build validation branch policy
    4. Create a pull request from feature branch to main branch in Repo A, the Build validation pipeline is triggered and successful. pull request