Skip to content

ci: publish to NuGet with Trusted Publishing - #348

Merged
erwan-joly merged 1 commit into
masterfrom
nuget-trusted-publishing
Nov 3, 2026
Merged

erwan-joly merged 1 commit into
masterfrom
nuget-trusted-publishing

Conversation

@erwan-joly

@erwan-joly erwan-joly commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

The NuGet API keys expired on 2026-11-01 and nuget.org now caps new keys at 30 days. This switches the release job to NuGet Trusted Publishing: the job exchanges a GitHub OIDC token for a short-lived API key via NuGet/login, so there is no stored key to rotate.

The matching Trusted Publishing policy (owner NosCore, repo NosCoreIO/NosCore.PathFinder, workflow dotnet.yml) is already active on nuget.org.

Once this is merged and a tag publishes successfully, the NUGET_API_KEY repo secret and the expired nuget.org key can be deleted.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Chores
    • Updated the authentication used when publishing releases.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Nov 3, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review.

Walkthrough

The release workflow adds token permissions and a conditional NuGet login step. The package push uses the API key output from that step instead of the repository secret.

Changes

NuGet release authentication

Layer / File(s) Summary
Release authentication and package push
.github/workflows/dotnet.yml
The release job grants id-token: write and runs the pinned NuGet login action when the tag check matches. The NuGet push uses the action’s NUGET_API_KEY output.

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

Change: Other

Merge Risk: Minimal · up to 4696e

The Trusted Publishing authentication path is internally consistent, and no actionable publishing defect is established. This change is mergeable with normal checks.

Pre-merge checks: Passed 5
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title "ci: publish to NuGet with Trusted Publishing" matches the main change. The release job in .github/workflows/dotnet.yml now grants id-token: write, exchanges an OIDC token through NuGet/logi…
Docstring Coverage Passed No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentat…
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 "ci: publish to NuGet with Trusted Publishing" matches the main change. The release job in .github/workflows/dotnet.yml now grants id-token: write, exchanges an OIDC token through NuGet/login, and pushes with the login step's API key output instead of the stored NUGET_API_KEY secret. The title is short, specific, and uses a conventional commit prefix.

Full details: Docstring Coverage

Explanation

No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 0 functions across 0 files. (1 skipped: 1 unsupported.)

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

CodeRabbit Verify

  • Run CodeRabbit Verify to test the changes in this pull request.
Recent review info
Run configuration
Commits

Reviewing files that changed from the base of the PR and between 6917902 and 4696e4b.

Files selected for processing: 1
  • .github/workflows/dotnet.yml

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

@erwan-joly
erwan-joly merged commit 1f2167f into master Nov 3, 2026
4 checks passed
@erwan-joly
erwan-joly deleted the nuget-trusted-publishing branch November 3, 2026 09: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