NuGet upload loop can report success after an earlier package push fails
Nobody has claimed this yet.
- Dominant language
- C#
- Stars
- 7.8k
- Forks
- 1.2k
- Avg merge
- 2d 17h
- Merged PRs (30d)
- 49
Description
Release Type: GitHub release automation
Version: master at 1714e21ce4f8706e38100896a3f017ac29ba5026
Platform: PowerShell release step; isolated reproduction with PowerShell 7.6.5 on macOS, using a stub publisher and no registry access.
Describe the bug
In release-deploy.yml, Push NuGet packages, each loop invokes dotnet nuget push without checking its exit status. With the default $PSNativeCommandUseErrorActionPreference = $false, an earlier failed upload can be overwritten by a later successful native command. The step then exits zero and the subsequent tag/release steps can proceed.
To reproduce
- Extract the existing
Push NuGet packagesrun block into a temporary.ps1file. - Create empty fixture files under
bin/packages:Stride.Core.4.4.0-beta6.nupkg,Stride.Engine.4.4.0-beta6.nupkg, andStride.GameStudio.4.4.0-beta6.nupkg. - Put a native executable named
dotnetfirst onPATHthat returns exit 1 for the Core filename and exit 0 for the others. Do not use a real publisher. - Execute with GitHub's documented PowerShell wrapper: prepend
$ErrorActionPreference = 'stop', appendif ((Test-Path -LiteralPath variable:\LASTEXITCODE)) { exit $LASTEXITCODE }.
Observed: the simulated Core upload failed; Engine and GameStudio continued; the script exited 0. Adding an immediate $LASTEXITCODE check after each push made the same fixture exit 1.
Expected behavior
An upload failure must make the step fail, even if independent uploads continue. Check every push and either stop immediately or collect failures and exit nonzero at the end. GameStudio should not publish when required providers failed. --skip-duplicate is useful recovery behavior and should remain where intended.
Additional context
This is an isolated reproduction of the checked-in loop, not a claim that an official release currently has missing packages. GitHub's shell documentation explains the last-exit-code wrapper.
Disclosure: I maintain dispat and found this while reviewing release failure propagation. The fix belongs in the existing workflow.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in .github/workflows/release-deploy.yml, in the Push NuGet packages run block at lines 128-175, and inspect how each dotnet nuget push result is handled. Reproduce with the listed bin/packages fixtures and stub dotnet executable, then verify that a failed provider upload makes the step nonzero and prevents GameStudio publication while preserving intended --skip-duplicate behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp, github-actions, powershell
- Domain
- ci-cd, release
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Active
- Clarity
- Clearly specified
- Newbie friendliness
- 88/100