Switch NuGet publish workflow to trusted publishing - #137
Merged
Conversation
Co-authored-by: wforney <[email protected]>
Copilot created this pull request from a session on behalf of
wforney
August 13, 2026 09:09
View session
wforney
marked this pull request as ready for review
August 13, 2026 09:09
SummarySummary
CoverageSharedCode.Core - 27.3%
SharedCode.Core.Tests - 98.1%
SharedCode.Data - 8.3%
SharedCode.Data.Tests - 100%
|
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the release workflow to publish NuGet packages to nuget.org using GitHub OIDC trusted publishing, replacing the prior long-lived NuGet API key secret approach.
Changes:
- Grants the
nuget-publishjobid-token: writeso it can request an OIDC token at runtime. - Adds
NuGet/login@v1to exchange the OIDC token for a short-lived NuGet API key. - Updates
dotnet nuget pushto use the ephemeral API key output from the login step.
💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
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.
The release workflow still published to nuget.org with a long-lived API key secret. This updates the NuGet publish job to use GitHub OIDC trusted publishing and a short-lived credential issued at runtime.
What changed
id-token: writeto thenuget-publishjob so GitHub Actions can request an OIDC token for nuget.org.NuGet/login@v1to exchange the OIDC token for a temporary NuGet API key.NUGET_API_KEYsecret indotnet nuget pushwith the ephemeral key from the login step.Workflow impact
Updated publish path