Change variable used to bypass nuget security scanning (#19907)

* Add debugging output to determine whether the nuget.config really does have multiple feeds.

* Fix up all the nuget config changes

* Add new variable.

* Revert "Fix up all the nuget config changes"

This reverts commit 04a963da70011c48b9c50ef9d02a9eed2a06cc67.

---------

Co-authored-by: James Truher <jimtru@microsoft.com>
This commit is contained in:
Travis Plunk
2023-07-07 20:33:53 +00:00
committed by GitHub
co-authored by James Truher
parent 56ef8481a3
commit 8eb767d009
2 changed files with 17 additions and 6 deletions
@@ -34,6 +34,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
@@ -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'], ''))
- pwsh: |
Import-Module ${{ parameters.repoRoot }}/build.psm1 -Force
New-NugetConfigFile -NugetFeedUrl $(PSInternalNugetFeed) -UserName $(PSInternalNugetFeedUserName) -ClearTextPAT $(PSInternalNugetFeedPAT) -FeedName AzDevOpsFeed -Destination '${{ parameters.repoRoot }}'
env:
NugetConfigDir: ${{ parameters.repoRoot }}/src/Modules
if(-not (Test-Path "${{ parameters.repoRoot }}/nuget.config"))
- pwsh: |
$configPath = "${env:NugetConfigDir}/nuget.config"
Import-Module ${{ parameters.repoRoot }}/build.psm1 -Force
New-NugetConfigFile -NugetFeedUrl $(PSInternalNugetFeed) -UserName $(PSInternalNugetFeedUserName) -ClearTextPAT $(PSInternalNugetFeedPAT) -FeedName AzDevOpsFeed -Destination "${env:NugetConfigDir}"
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'