Skip to content

Use NuGet trusted publishing (OIDC) for nuget.org push - #27

Merged
Sandoun merged 1 commit into
masterfrom
ci/nuget-trusted-publishing
Jul 25, 2026
Merged

Use NuGet trusted publishing (OIDC) for nuget.org push#27
Sandoun merged 1 commit into
masterfrom
ci/nuget-trusted-publishing

Conversation

@Sandoun

@Sandoun Sandoun commented Jul 25, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Switches the nuget.org push in publish-pipeline.yml from a long-lived NUGET_TOKEN API key secret to NuGet Trusted Publishing: a short-lived API key obtained via GitHub Actions OIDC through the NuGet/login@v1 action.
  • Splits the old combined "Publish" step into two: GitHub Packages push (unchanged, still uses GITHUB_TOKEN) and NuGet.org push (now OIDC-based).
  • permissions: write-all at the workflow level already grants id-token: write, so no extra permissions block was needed.

Replaces the long-lived NUGET_TOKEN secret with a short-lived API key
obtained via GitHub Actions OIDC through the NuGet/login action, per
https://learn.microsoft.com/en-us/nuget/nuget-org/trusted-publishing.
The GitHub Packages push is unaffected and still uses GITHUB_TOKEN.

Requires a NUGET_USER repo secret (nuget.org username) and a Trusted
Publishing policy configured on nuget.org for this repo/workflow file.
The NUGET_TOKEN secret can be removed once this is verified working.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@Sandoun
Sandoun merged commit 3d68f0f into master Jul 25, 2026
1 check passed
@Sandoun
Sandoun deleted the ci/nuget-trusted-publishing branch July 25, 2026 19:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant