Skip to content

Switch NuGet publishing to Trusted Publishing (OIDC) - #3752

Merged
kblok merged 1 commit into
masterfrom
claude/nuget-trusted-publishing-yivfqj
Nov 13, 2026
Merged

kblok merged 1 commit into
masterfrom
claude/nuget-trusted-publishing-yivfqj

Conversation

@kblok

@kblok kblok commented Nov 13, 2026 •

Copy link
Copy Markdown
Member

Summary

The NuGet publish workflow failed with the stored API key. This switches PushNugetPackageToNugetOrg.yml to NuGet Trusted Publishing (OIDC).

  • Add permissions: id-token: write and contents: read to the job.
  • Add a NuGet/login@v1 step that exchanges the OIDC token for a temporary API key (user: kblok, the nuget.org profile name).
  • Both pushes (PuppeteerSharp and PuppeteerSharp.Cdp) now use steps.login.outputs.NUGET_API_KEY.
  • Remove the NUGET_API_KEY secret-exists conditions.

Before relying on it

  • The Trusted Publishing policy on nuget.org must be saved (owner hardkoded, repo puppeteer-sharp, workflow PushNugetPackageToNugetOrg.yml, no environment).
  • Confirm kblok is the right nuget.org profile name.
  • After a successful publish, the NUGET_API_KEY secret can be deleted and the old key revoked.

Not tested: the workflow has not been run on this branch.


Generated by Claude Code

Summary by CodeRabbit

  • Chores
    • Updated package publishing to use NuGet’s trusted publishing sign-in for both standard and CDP-only packages. The publishing steps no longer rely on a repository API key secret or skip when it is absent.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Ls2e1zRMdL5U4mTo3s1tgo
@coderabbitai

coderabbitai Bot commented Nov 13, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The NuGet publishing workflow now uses OIDC login. It uses the login action’s NUGET_API_KEY output for standard and CDP-only package pushes instead of a repository secret.

Changes: NuGet OIDC publishing

Layer / File(s) Summary
OIDC login and package pushes
.github/workflows/PushNugetPackageToNugetOrg.yml
The job grants id-token: write and contents: read permissions and adds NuGet OIDC login with the kblok profile. Both package pushes use the login action’s NUGET_API_KEY output. The secret-based conditions are removed.

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Other

Sequence Diagram(s)

sequenceDiagram
  participant Workflow as GitHub Actions workflow
  participant Login as NuGet OIDC login action
  participant NuGet as NuGet.org
  Workflow->>Login: Run login with the kblok profile
  Login-->>Workflow: Return NUGET_API_KEY output
  Workflow->>NuGet: Push standard package with output
  Workflow->>NuGet: Push CDP-only package with output
Loading

Suggested reviewers: steveberdy, stesee

Merge Risk: Minimal · up to 5216e

The publishing workflow now authenticates through OIDC Trusted Publishing instead of a stored key. The workflow has not yet run on this branch, so confirm that the nuget.org policy matches the repository, workflow file and profile name before relying on it for a release. No defect in the change itself was found.

Pre-merge checks: Passed 4

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title "Switch NuGet publishing to Trusted Publishing (OIDC)" matches the main change in the workflow. The workflow adds id-token: write and contents: read permissions, adds a NuGet/login step that…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title "Switch NuGet publishing to Trusted Publishing (OIDC)" matches the main change in the workflow. The workflow adds id-token: write and contents: read permissions, adds a NuGet/login step that exchanges an OIDC token for a temporary API key, and uses that key for both the PuppeteerSharp and PuppeteerSharp.Cdp pushes. The title is concise, specific, and free of file lists or vague terms.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 4ba9cddd-b8ed-4888-b087-82fcb8aeddfb
Commits

Reviewing files that changed from the base of the PR and between 56389b2 and 5216e9a.

Files selected for processing: 1

  • .github/workflows/PushNugetPackageToNugetOrg.yml

Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 7 remain after this review.

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