azure-devopscontinuous-integrationazure-pipelinesbuild-pipeline

Azure pipelines running version of build pipeline on build policy


Which branch does the build pipeline runs on a PR? I mean, you can set a build pipeline to run during a PR, but the docs doesn't clarify from which branch version does this pipeline will run. My teams doesn't use gitflow, so for sure it isn't the "default branch" settings (because my build pipeline doesn't even exists on the default branch of the repository (main). On the following image it's my current build policy settings:

build settings for branch D

supose my fraudchecker-build exists on branches A,B and C. Each branch has a differen't "version/code" of this pipeline. How can i know, when i set a build policy, which branch the fraudchecker-build will execute during a PR: A,B or C? I can't assume it will be the current branch where i'm setting de build policy (supose it is branch D)

doc page: azure pipelines doc page


Solution

  • The pipeline will build and validate the code from the source branch i.e. if you create a PR to merge branch B into main, it will build on branch B code

    Edit - AS Vince stated I've simplified it too much in my post. It runs on the combined code of the source and target branch i.e. what the target branch will look like post PR completion