Repository navigation
Publish to nuget.org through trusted publishing instead of an API key - #45
Merged
Merged
Conversation
The org-wide NUGET_ORG_API_KEY secret expired, so tagged releases could no longer push. NuGet/login now exchanges the workflow's OIDC token for a short-lived key under a nuget.org trusted-publishing policy for this repository's ci.yml, leaving no long-lived key to rotate. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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 org-wide
NUGET_ORG_API_KEYsecret has expired, so tagged releases can no longer push to nuget.org. This switches the push to NuGet trusted publishing:NuGet/loginexchanges the workflow's GitHub OIDC token for a nuget.org API key that lives for an hour, so there is no long-lived key left to expire or rotate. Same change as nullean/curb#193.Change (
.github/workflows/ci.yml, jobbuild)id-token: writeadded to the job's permissions, so it can request an OIDC token.NuGet/login@v1step (idnuget-login,user: ${{ secrets.NUGET_USER }}) placed immediately before the nuget.org push, with the same tag-only condition as the push.${{ steps.nuget-login.outputs.NUGET_API_KEY }}instead ofsecrets.NUGET_ORG_API_KEY.--skip-duplicateis kept. The GitHub Packages canary push (GITHUB_TOKEN) is unchanged.Prerequisites before the next release
assembly-differ, workflowci.yml, no environment.NUGET_USERholding the nuget.org profile name (Mpdreamz).Testing
Validated with
actionlintand a YAML parse. PR CI does not run the publish steps (they only run on tag pushes), so this can only be proven by the next tagged release.🤖 Generated with Claude Code