Repository navigation
Publish NuGet packages with trusted publishing - #622
Merged
Merged
Conversation
Exchange a GitHub OIDC token for a short-lived NuGet API key with NuGet/login instead of pushing with the long-lived NUGET_API_KEY secret. 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 @@
## master #622 +/- ##
=======================================
Coverage 74.93% 74.93%
=======================================
Files 454 454
Lines 38490 38490
Branches 5322 5322
=======================================
Hits 28843 28843
Misses 8495 8495
Partials 1152 1152 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This comment has been minimized.
This comment has been minimized.
Only the publish job gets id-token: write, so branch builds, and the MSBuild code they run, can never request a token nuget.org would accept. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Enkidu93
approved these changes
Nov 6, 2026
Enkidu93
left a comment
Collaborator
There was a problem hiding this comment.
@Enkidu93 reviewed 1 file and all commit messages, and made 1 comment.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on ddaspit).
The environment accepts only v* tags, so binding the nuget.org trust policy to it stops a branch that edits ci.yml from requesting a publish token. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
Public API, target framework, package, or machine.py parity contract changed: None verified. Releases now depend on the nuget.org trust policy and the Findings: F1 addressed; F2 withdrawn, unverified. Reviewed at 4b337d9 |
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.
Quick summary
Tagged releases now push to nuget.org with a short-lived key from trusted publishing. The long-lived
NUGET_API_KEYsecret is no longer used. Build, test, and pack steps are unchanged.Where to look
publishjob -- the only job withid-token: write. It runs in thenugetenvironment, which accepts onlyv*tags.After the first release
NUGET_API_KEYand revoke that key on nuget.org.Validation
python -c "import yaml; yaml.safe_load(open('.github/workflows/ci.yml'))"-- parsesgit diff --check master...HEAD-- clean./local_check.sh-- not run; the change is workflow-only and touches no build or test input🤖 Generated with Claude Code
This change is