Skip to content

[publish] wire up OIDC token for NuGet trusted publishing - #5

Merged
sharanmoore merged 1 commit into
mainfrom
fix/nuget-oidc-push
Jun 22, 2026
Merged

[publish] wire up OIDC token for NuGet trusted publishing#5
sharanmoore merged 1 commit into
mainfrom
fix/nuget-oidc-push

Conversation

@sharanmoore

Copy link
Copy Markdown
Contributor

Stack Overview

The publish workflow was failing with a 401 because dotnet nuget push doesn't automatically use the GitHub Actions OIDC token — it needs it passed explicitly as --api-key. Having id-token: write permission only grants the workflow the ability to request a token; it doesn't inject it into the push command.


What does this PR do?

Adds a step that requests an OIDC token with audience api.nuget.org via actions/github-script, then passes it as --api-key to the push command. This is the correct pattern for NuGet.org trusted publishing from GitHub Actions.

dotnet nuget push needs the OIDC token passed explicitly
as --api-key with audience api.nuget.org; id-token: write
permission alone is not sufficient.
@sharanmoore
sharanmoore requested review from a team as code owners June 22, 2026 14:44
@sharanmoore
sharanmoore merged commit 12ba8ab into main Jun 22, 2026
7 checks passed
@sharanmoore
sharanmoore deleted the fix/nuget-oidc-push branch June 22, 2026 16:05
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.

2 participants