@@ -423,21 +423,29 @@ jobs:
423
423
- ' !sdk/**/test-recordings'
424
424
- ' !sdk/**/session-records'
425
425
426
- - template : /eng/pipelines/templates/steps/generate-project-list-and-cache-maven-repository.yml
427
- parameters :
428
- Artifacts : ${{ parameters.Artifacts }}
429
- AdditionalModules : ${{ parameters.AdditionalModules }}
430
- JobType : ' Compliance'
431
- UseCache : false
426
+ # For PullRequests CredScan will be run against the files changed in the PR.
427
+ # For non-pull requests CredScan
428
+ - ${{if eq(variables['Build.Reason'], 'PullRequest')}} :
429
+ - pwsh : |
430
+ $changedFiles = & "eng/common/scripts/get-changedfiles.ps1"
431
+ $tmp = ConvertTo-Json @($changedFiles | Sort-Object | Get-Unique) -Compress
432
+ Write-Host "##vso[task.setvariable variable=SparseCheckoutDirectories;]$tmp"
433
+ - ${{else}} :
434
+ - template : /eng/pipelines/templates/steps/generate-project-list-and-cache-maven-repository.yml
435
+ parameters :
436
+ Artifacts : ${{ parameters.Artifacts }}
437
+ AdditionalModules : ${{ parameters.AdditionalModules }}
438
+ JobType : ' Compliance'
439
+ UseCache : false
432
440
433
- - task : PowerShell@2
434
- displayName : Generate directories variable for sparse checkout
435
- inputs :
436
- pwsh : true
437
- filePath : $(Build.SourcesDirectory)/eng/scripts/Generate-ServiceDirectories-From-Project-List.ps1
438
- arguments : >
439
- -SourcesDirectory $(Build.SourcesDirectory)
440
- -ProjectList $(ProjectList)
441
+ - task : PowerShell@2
442
+ displayName : Generate directories variable for sparse checkout
443
+ inputs :
444
+ pwsh : true
445
+ filePath : $(Build.SourcesDirectory)/eng/scripts/Generate-ServiceDirectories-From-Project-List.ps1
446
+ arguments : >
447
+ -SourcesDirectory $(Build.SourcesDirectory)
448
+ -ProjectList $(ProjectList)
441
449
442
450
# Skip sparse checkout for the `azure-sdk-for-<lang>-pr` private mirrored repositories
443
451
# as we require the GitHub service connection to be loaded.
0 commit comments