Skip to content

ci: publish to NuGet with Trusted Publishing - #184

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.ParserInputGenerator, 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 packages for matching version tags. Package creation and release-asset uploads remain unchanged, so the release process continues to produce the same deliverables. No changes to app features or behavior are included in this update.

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 tag-gated NuGet login. The package push uses the API key returned by the login action instead of the repository secret.

Changes

NuGet release authentication

Layer / File(s) Summary
Configure NuGet release authentication
.github/workflows/dotnet.yml
The release job grants id-token: write. For matching tags, it runs the pinned NuGet/login action as 0Lucifer0 and uses the action’s NUGET_API_KEY output for the NuGet push.

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

Change: Other

Merge Risk: Minimal · up to e8ad4

The workflow switches publishing to short-lived NuGet credentials. No actionable merge-blocking issue is established; the external Trusted Publishing configuration remains an operational prerequisite.

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, runs the NuGet/login action on version tag…
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, runs the NuGet/login action on version tags, and pushes the package with the short-lived API key from that login step instead of the NUGET_API_KEY secret. The title is short, single-sentence, and specific. It names the core change and uses the conventional ci: 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 6424a62 and e8ad46a.

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