Switch NuGet publishing to trusted publishing (OIDC) - #54
Merged
Conversation
Co-authored-by: SteveWinward <2002602+SteveWinward@users.noreply.github.com>
Copilot created this pull request from a session on behalf of
SteveWinward
September 2, 2026 14:17
View session
SteveWinward
marked this pull request as ready for review
September 2, 2026 14:22
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 published to NuGet.org with a long-lived
NUGET_API_KEYsecret. This switches it to NuGet's trusted publishing model, using the newly createdNUGET_USERsecret (the NuGet profile name).Changes to
.github/workflows/release_build.ymlNuGet/login@v1step that exchanges the workflow's OIDC token for a short-lived API key.id-token: write(and explicitcontents: read) so OIDC token issuance works.dotnet nuget pushnow consumes the step output instead of the static secret.Follow-up once verified: the
NUGET_API_KEYrepository secret is no longer referenced and can be deleted. A trusted publishing policy for this repo/workflow must exist on the NuGet.org profile for the login step to succeed.Note:
NuGet/loginis pinned to thev1tag to match the existing style of other actions in this workflow; pinning to a commit SHA would be a hardening option if preferred repo-wide.