Repository navigation
chore: Publish to nuget.org with trusted publishing - #90
Merged
Merged
Conversation
Swap the long-lived NuGet API key secret for nuget.org trusted publishing: the release job gets an OIDC token (id-token: write), NuGet/login exchanges it for a one-hour API key, and dotnet nuget push uses that key. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01YUXrZTZXQWDbUQnK4Fx47r
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues remain for the migration to NuGet trusted publishing.
No open issues 🎉
What changed in this PR
Migrates the NuGet release workflow from a long-lived API key to nuget.org trusted publishing, removing the need to rotate a stored publishing credential.
Changes:
- Grants the release job read access to repository contents and permission to request an OIDC token.
- Adds
NuGet/login@v1, usingvars.NUGET_USERto obtain a short-lived API key. - Uses that key for package publishing while preserving the existing versionize success condition.
| File | Description |
|---|---|
.github/workflows/dotnet-release.yml |
Adds trusted publishing authentication and replaces the stored NuGet API key. |
Review effort: Balanced
JacobAtchley
approved these changes
Nov 6, 2026
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.
What changed
dotnet-release.ymlnow publishes with nuget.org trusted publishing instead of the long-livedFIREBEND_NUGET_KEYsecret:permissions: contents: read, id-token: write(checkout and the version push still use the PAT)NuGet/login@v1step exchanges the GitHub OIDC token for a one-hour NuGet API keydotnet nuget pushusessteps.nuget-login.outputs.NUGET_API_KEYWhy
The shared NuGet API key expired (jobba release run 42282909910 failed with
403 The specified API key has expired). Trusted publishing removes the stored key, so there is nothing to rotate or leak.Prerequisites (before merge)
Firebend, repofirebend/json-patch-generator, workflowdotnet-release.yml, packagesFirebend.JsonPatchGeneratorNUGET_USER=MarcusCarey(nuget.org username of the policy creator)How to test
The workflow only runs on push to
main, so the first release after merge is the test: theNuGet loginstep succeeds andPublishpushes the packages.chore:is insignificant to versionize, so this PR alone does not cut a release.After a successful publish: delete the
FIREBEND_NUGET_KEYsecret and revoke the expired key on nuget.org.Same change in jobba, auto-crud, lit-redis, json-patch-generator.
🤖 Generated with Claude Code
https://claude.ai/code/session_01YUXrZTZXQWDbUQnK4Fx47r