File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed
eng/common/pipelines/templates/steps Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -7,8 +7,9 @@ parameters:
7
7
steps :
8
8
- pwsh : |
9
9
if ("$(Build.Reason)" -eq 'PullRequest') {
10
- (git diff "origin/$(System.PullRequest.TargetBranch)" HEAD --name-only)
11
- | ForEach-Object { Add-Content -Path "${{ parameters.SourceDirectory }}/credscan.tsv" -Value "${{ parameters.SourceDirectory }}/$_"}
10
+ $targetBranch = "origin/$(System.PullRequest.TargetBranch)" -replace "/refs/heads/"
11
+ $changedFiles = git diff $targetBranch HEAD --name-only --diff-filter=d
12
+ $changedFiles | ForEach-Object { Add-Content -Path "${{ parameters.SourceDirectory }}/credscan.tsv" -Value "${{ parameters.SourceDirectory }}/$_"}
12
13
}
13
14
else {
14
15
Set-Content "${{ parameters.SourceDirectory }}/credscan.tsv" -Value "${{ parameters.SourceDirectory }}/sdk/${{ parameters.ServiceDirectory }}"
You can’t perform that action at this time.
0 commit comments