Fixed the prefix of the target branch (#3338)

Co-authored-by: sima-zhu <sizhu@microsoft.com>
This commit is contained in:
Azure SDK Bot 2022-02-10 16:00:47 -08:00 committed by GitHub
parent c905080138
commit dc1ce53a34
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

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