Skip to content

Switch to NuGet trusted publishing (OIDC) - #23

Merged
johnkors merged 1 commit into
mainfrom
jk/trusted-publishing-oidc
Sep 13, 2026
Merged

johnkors merged 1 commit into
mainfrom
jk/trusted-publishing-oidc

Conversation

@johnkors

Copy link
Copy Markdown
Owner

Summary

  • Replaces the NUGETORGAPIKEY long-lived secret with GitHub Actions OIDC trusted publishing
  • Adds a NuGet/login@v1 step to Release.yml and PreRelease.yml that exchanges the workflow's OIDC token for a short-lived (~1hr) nuget.org API key
  • Grants id-token: write permission (both workflows) and contents: write (Release.yml only, needed for release/notes creation now that a permissions: block is present)

Test plan

  • Confirm nuget.org trusted publishing policies exist for PreRelease.yml and Release.yml workflow files on this repo
  • Run PreRelease workflow via workflow_dispatch and confirm it pushes successfully
  • Run Release workflow via workflow_dispatch and confirm it pushes + creates the GitHub release successfully
  • Remove the now-unused NUGETORGAPIKEY repo secret

🤖 Generated with Claude Code

Replaces the long-lived NUGETORGAPIKEY secret with a short-lived
API key obtained via NuGet/login@v1, using GitHub Actions OIDC.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@johnkors
johnkors merged commit 48c89d2 into main Sep 13, 2026
4 checks passed
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