From 485d02ae08b2755ae4683666499ea43bb08950a1 Mon Sep 17 00:00:00 2001 From: Azure SDK Bot <53356347+azure-sdk@users.noreply.github.com> Date: Thu, 10 Feb 2022 16:00:49 -0800 Subject: [PATCH] Fixed the prefix of the target branch (#17037) Co-authored-by: sima-zhu --- eng/common/pipelines/templates/steps/credscan.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eng/common/pipelines/templates/steps/credscan.yml b/eng/common/pipelines/templates/steps/credscan.yml index c57ed7a4d9f1..029b370e0b03 100644 --- a/eng/common/pipelines/templates/steps/credscan.yml +++ b/eng/common/pipelines/templates/steps/credscan.yml @@ -7,7 +7,7 @@ parameters: steps: - pwsh: | if ("$(Build.Reason)" -eq 'PullRequest') { - $targetBranch = "origin/$(System.PullRequest.TargetBranch)" -replace "/refs/heads/" + $targetBranch = "origin/$(System.PullRequest.TargetBranch)" -replace "refs/heads/" $changedFiles = git diff $targetBranch HEAD --name-only --diff-filter=d $changedFiles | ForEach-Object { Add-Content -Path "${{ parameters.SourceDirectory }}/credscan.tsv" -Value "${{ parameters.SourceDirectory }}/$_"} }