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 }}/$_"} }