Skip to content

C#: pass --skip-duplicate to dotnet nuget push#7544

Merged
jkschneider merged 1 commit intomainfrom
tim/dotnet-snapshot-fail
May 2, 2026
Merged

C#: pass --skip-duplicate to dotnet nuget push#7544
jkschneider merged 1 commit intomainfrom
tim/dotnet-snapshot-fail

Conversation

@timtebeek
Copy link
Copy Markdown
Member

The scheduled daily CI run fails on the NuGet publish step whenever no new commit has landed since the previous run. The C# snapshot version is derived from the latest commit timestamp, so the .nupkg filename is identical to yesterday's; NuGet versions are immutable, so dotnet nuget push exits non-zero and turns the whole publish step red (e.g. https://github.com/openrewrite/rewrite/actions/runs/25222223491).

Adding --skip-duplicate makes NuGet treat an already-uploaded version as a logged warning instead of an error, matching how Maven -SNAPSHOT re-uploads behave.

Test plan

  • Trigger ci.yml via workflow_dispatch twice without an intervening commit; second run succeeds with a "package already exists, skipped" log line.
  • Tag-driven publish.yml still pushes a fresh release version successfully.

NuGet versions are immutable, so the daily scheduled publish failed
whenever no new commit had landed since the previous run (the snapshot
version is derived from the latest commit timestamp). `--skip-duplicate`
turns the duplicate response into a logged warning instead of an error.
@github-project-automation github-project-automation Bot moved this to In Progress in OpenRewrite May 1, 2026
@timtebeek timtebeek requested a review from macsux May 1, 2026 16:34
@timtebeek timtebeek moved this from In Progress to Ready to Review in OpenRewrite May 1, 2026
@jkschneider jkschneider merged commit 476111a into main May 2, 2026
1 check passed
@jkschneider jkschneider deleted the tim/dotnet-snapshot-fail branch May 2, 2026 14:59
@github-project-automation github-project-automation Bot moved this from Ready to Review to Done in OpenRewrite May 2, 2026
timtebeek added a commit that referenced this pull request May 3, 2026
npm has no `--skip-duplicate`, so the daily scheduled publish failed
with a 403 whenever no new commit had landed since the previous run
(the snapshot version is derived from the latest commit timestamp).
Mirrors the intent of #7544 for NuGet.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants