Skip to content

Commit

Permalink
Change variable used to bypass nuget security scanning (#19953)
Browse files Browse the repository at this point in the history
  • Loading branch information
TravisEz13 committed Jul 12, 2023
1 parent 351092f commit 67025f1
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 4 deletions.
2 changes: 2 additions & 0 deletions tools/releaseBuild/azureDevOps/compliance.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ variables:
value: 1
- name: POWERSHELL_TELEMETRY_OPTOUT
value: 1
- name: nugetMultiFeedWarnLevel
value: none
- name: NugetSecurityAnalysisWarningLevel
value: none
# Defines the variables AzureFileCopySubscription, StorageAccount, StorageAccountKey, StorageResourceGroup, StorageSubscriptionName
Expand Down
2 changes: 2 additions & 0 deletions tools/releaseBuild/azureDevOps/releaseBuild.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ variables:
value: 1
- name: POWERSHELL_TELEMETRY_OPTOUT
value: 1
- name: nugetMultiFeedWarnLevel
value: none
- name: NugetSecurityAnalysisWarningLevel
value: none
# Prevents auto-injection of nuget-security-analysis@0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,25 +4,34 @@ parameters:

steps:
- pwsh: |
$configPath = "${env:NugetConfigDir}/nuget.config"
Import-Module ${{ parameters.repoRoot }}/build.psm1 -Force
New-NugetConfigFile -NugetFeedUrl $(AzDevOpsFeed) -UserName $(AzDevOpsFeedUserName) -ClearTextPAT $(AzDevOpsFeedPAT2) -FeedName AzDevOpsFeed -Destination '${{ parameters.repoRoot }}/src/Modules'
New-NugetConfigFile -NugetFeedUrl $(AzDevOpsFeed) -UserName $(AzDevOpsFeedUserName) -ClearTextPAT $(AzDevOpsFeedPAT2) -FeedName AzDevOpsFeed -Destination "${env:NugetConfigDir}"
if(-not (Test-Path "${{ parameters.repoRoot }}/src/Modules/nuget.config"))
if(-not (Test-Path $configPath))
{
throw "nuget.config is not created"
}
Get-Content $configPath | Write-Verbose -Verbose
displayName: 'Add nuget.config for Azure DevOps feed for PSGallery modules'
condition: and(succeededOrFailed(), ne(variables['AzDevOpsFeed'], ''))
env:
NugetConfigDir: ${{ parameters.repoRoot }}/src/Modules

- pwsh: |
$configPath = "${env:NugetConfigDir}/nuget.config"
Import-Module ${{ parameters.repoRoot }}/build.psm1 -Force
New-NugetConfigFile -NugetFeedUrl $(PSInternalNugetFeed) -UserName $(PSInternalNugetFeedUserName) -ClearTextPAT $(PSInternalNugetFeedPAT) -FeedName AzDevOpsFeed -Destination '${{ parameters.repoRoot }}'
New-NugetConfigFile -NugetFeedUrl $(PSInternalNugetFeed) -UserName $(PSInternalNugetFeedUserName) -ClearTextPAT $(PSInternalNugetFeedPAT) -FeedName AzDevOpsFeed -Destination "${env:NugetConfigDir}"
if(-not (Test-Path "${{ parameters.repoRoot }}/nuget.config"))
if(-not (Test-Path $configPath))
{
throw "nuget.config is not created"
}
Get-Content $configPath | Write-Verbose -Verbose
displayName: 'Add nuget.config for Azure DevOps feed for packages'
condition: and(succeededOrFailed(), ne(variables['PSInternalNugetFeed'], ''))
env:
NugetConfigDir: ${{ parameters.repoRoot }}

- task: nuget-security-analysis@0
displayName: 'Run Secure Supply Chain analysis'
Expand Down

0 comments on commit 67025f1

Please sign in to comment.