Repository navigation
Publish to nuget.org with Trusted Publishing - #530
Merged
Merged
Conversation
Exchange the release job's GitHub OIDC token for a short-lived nuget.org API key via NuGet/login, replacing the long-lived NUGET_TOKEN secret. The job runs in the "release" environment, which is restricted to v* tags and matches the nuget.org Trusted Publishing policy. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #530 +/- ##
=======================================
- Coverage 80.5% 80.4% -0.1%
=======================================
Files 130 130
Lines 9503 9503
Branches 1432 1432
=======================================
- Hits 7652 7644 -8
- Misses 1358 1366 +8
Partials 493 493 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
NUGET_TOKENAPI key stored as a repo secret. NuGet now discourages API keys for CI and recommends Trusted Publishing instead.release.ymlnow trades the job's GitHub OIDC token for a nuget.org API key that lasts 1 hour (NuGet/login, pinned to the v1.2.0 commit). It requests the key after the pack step and uses it for both pushes. The workflow now needsid-token: write.releaseenvironment. That environment only allowsv*tags and matches the environment set in the nuget.org policy, so a modified copy of the workflow on another branch can't publish.