From 7bfacd55d89524ee2bce68e5ae863222c4609f68 Mon Sep 17 00:00:00 2001 From: Julius Marminge Date: Fri, 8 May 2026 15:20:02 -0700 Subject: [PATCH] [codex] Handle NuGet provider bootstrap failures (#2608) Co-authored-by: Julius Marminge --- .github/workflows/release.yml | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 382bd6f1eb19ad9a48ce2a920065d12f5d16ddbe..e99f852feecc698777d8189cd420ddf696c84c18 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -272,11 +272,16 @@ jobs: exit 0 } - Install-PackageProvider ` - -Name NuGet ` - -MinimumVersion 2.8.5.201 ` - -Force ` - -Scope CurrentUser + try { + Install-PackageProvider ` + -Name NuGet ` + -MinimumVersion 2.8.5.201 ` + -Force ` + -Scope CurrentUser ` + -ErrorAction Stop + } catch { + Write-Warning "Could not bootstrap NuGet package provider. Continuing because the runner may already have a usable provider. $($_.Exception.Message)" + } Install-Module ` -Name TrustedSigning ` @@ -284,7 +289,8 @@ jobs: -Force ` -AllowClobber ` -Repository PSGallery ` - -Scope CurrentUser + -Scope CurrentUser ` + -ErrorAction Stop Import-Module TrustedSigning -MinimumVersion 0.5.0 -Force Get-Command Invoke-TrustedSigning -ErrorAction Stop -- 2.54.0