Skip to content

Commit 7bfacd5

Browse files
juliusmarmingeJulius Marminge
andauthored
[codex] Handle NuGet provider bootstrap failures (#2608)
Co-authored-by: Julius Marminge <julius@macmini.local>
1 parent 271d65e commit 7bfacd5

1 file changed

Lines changed: 12 additions & 6 deletions

File tree

.github/workflows/release.yml

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -272,19 +272,25 @@ jobs:
272272
exit 0
273273
}
274274
275-
Install-PackageProvider `
276-
-Name NuGet `
277-
-MinimumVersion 2.8.5.201 `
278-
-Force `
279-
-Scope CurrentUser
275+
try {
276+
Install-PackageProvider `
277+
-Name NuGet `
278+
-MinimumVersion 2.8.5.201 `
279+
-Force `
280+
-Scope CurrentUser `
281+
-ErrorAction Stop
282+
} catch {
283+
Write-Warning "Could not bootstrap NuGet package provider. Continuing because the runner may already have a usable provider. $($_.Exception.Message)"
284+
}
280285
281286
Install-Module `
282287
-Name TrustedSigning `
283288
-MinimumVersion 0.5.0 `
284289
-Force `
285290
-AllowClobber `
286291
-Repository PSGallery `
287-
-Scope CurrentUser
292+
-Scope CurrentUser `
293+
-ErrorAction Stop
288294
289295
Import-Module TrustedSigning -MinimumVersion 0.5.0 -Force
290296
Get-Command Invoke-TrustedSigning -ErrorAction Stop

0 commit comments

Comments
 (0)