Use commit parents instead of branch names to evaulate changed paths. (#44474)
authorJeremy Koritzinsky <jekoritz@microsoft.com>
Tue, 10 Nov 2020 18:55:27 +0000 (10:55 -0800)
committerGitHub <noreply@github.com>
Tue, 10 Nov 2020 18:55:27 +0000 (10:55 -0800)
eng/pipelines/common/checkout-job.yml

index 297a4b5..9d7f427 100644 (file)
@@ -52,7 +52,9 @@ jobs:
         parameters:
           subsetName: ${{ path.subset }} 
           arguments:
-          - --difftarget origin/$(System.PullRequest.TargetBranch)
+          # The commit that we're building is always a merge commit that is merging into the target branch.
+          # So the first parent of the commit is on the target branch and the second parent is on the source branch.
+          - --difftarget HEAD^1
           - --subset ${{ path.subset }}
           - ${{ if ne(path.include[0], '') }}:
             - --includepaths '${{ join('+', path.include) }}'