From 391610903b2944bb6bfed76fe9f9b46838600baf Mon Sep 17 00:00:00 2001 From: Sean Brogan Date: Tue, 24 Nov 2020 11:43:04 -0800 Subject: [PATCH] .azurepipelines/templates/pr-gate-steps.yml: Fetch target branch Add step to fetch target branch so that PR_EVAL can resolve diff Cc: Bret Barkelew Cc: Michael D Kinney Cc: Liming Gao Signed-off-by: Sean Brogan Reviewed-by: Michael D Kinney --- .azurepipelines/templates/pr-gate-steps.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.azurepipelines/templates/pr-gate-steps.yml b/.azurepipelines/templates/pr-gate-steps.yml index c1c0c04d6c..70c19a4621 100644 --- a/.azurepipelines/templates/pr-gate-steps.yml +++ b/.azurepipelines/templates/pr-gate-steps.yml @@ -31,6 +31,12 @@ steps: echo "##vso[task.setvariable variable=pkgs_to_build]${{ parameters.build_pkgs }}" echo "##vso[task.setvariable variable=pkg_count]${{ 1 }}" +# Fetch the target branch so that pr_eval can diff them. +# Seems like azure pipelines/github changed checkout process in nov 2020. +- script: git fetch origin $(System.PullRequest.targetBranch) + displayName: fetch target branch + condition: eq(variables['Build.Reason'], 'PullRequest') + # trim the package list if this is a PR - task: CmdLine@1 displayName: Check if ${{ parameters.build_pkgs }} need testing