Skip to content

ci: fix pipeline failing on duplicate NuGet package push#269

Merged
DavidDeSloovere merged 2 commits intomainfrom
copilot/fix-duplicate-package-push
Mar 6, 2026
Merged

ci: fix pipeline failing on duplicate NuGet package push#269
DavidDeSloovere merged 2 commits intomainfrom
copilot/fix-duplicate-package-push

Conversation

Copy link
Contributor

Copilot AI commented Mar 6, 2026

Re-runs of the CI workflow on the same commit/tag produce the same effective NuGet version because NuGet ignores SemVer build metadata (+N) when comparing versions, causing a 409 Conflict on the second push.

Changes

  • --skip-duplicate added to dotnet nuget push in ci.yml — silently skips already-published versions instead of failing
  • MINVERBUILDMETADATA syntax fixed — changed build.$GITHUB_RUN_ATTEMPT (unexpanded shell variable reference) to build.${{ github.run_attempt }} (valid GitHub Actions expression)
# Before
MINVERBUILDMETADATA: build.$GITHUB_RUN_ATTEMPT
run: dotnet nuget push "./artifacts/*.nupkg" --source "github" --api-key ${{ secrets.GITHUB_TOKEN }}

# After
MINVERBUILDMETADATA: build.${{ github.run_attempt }}
run: dotnet nuget push "./artifacts/*.nupkg" --source "github" --api-key ${{ secrets.GITHUB_TOKEN }} --skip-duplicate

✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

…A syntax

Co-authored-by: DavidDeSloovere <352626+DavidDeSloovere@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix error with duplicate package version during CI publishing Fix CI pipeline failing on duplicate NuGet package push Mar 6, 2026
@DavidDeSloovere DavidDeSloovere changed the title Fix CI pipeline failing on duplicate NuGet package push ci: fix pipeline failing on duplicate NuGet package push Mar 6, 2026
@DavidDeSloovere DavidDeSloovere marked this pull request as ready for review March 6, 2026 15:14
@DavidDeSloovere DavidDeSloovere merged commit 712c897 into main Mar 6, 2026
5 checks passed
@DavidDeSloovere DavidDeSloovere deleted the copilot/fix-duplicate-package-push branch March 6, 2026 15:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants