Skip to content

ci(release): migrate NuGet publish to Trusted Publishing / OIDC (#207) - #239

Merged
Chris-Wolfgang merged 1 commit into
vNextfrom
ci/oidc-trusted-publishing
Jul 24, 2026
Merged

ci(release): migrate NuGet publish to Trusted Publishing / OIDC (#207)#239
Chris-Wolfgang merged 1 commit into
vNextfrom
ci/oidc-trusted-publishing

Conversation

@Chris-Wolfgang

Copy link
Copy Markdown
Owner

Migrates release.yaml off secrets.NUGET_API_KEY and onto NuGet Trusted Publishing (OIDC) — the fleet-standard now on 9+ repos. Also unblocks #140 (the SECURITY.md OIDC release-path appendix can now be written).

The change (publish-nuget job)

  • Adds permissions: { id-token: write, contents: read }.
  • Replaces the "Validate NuGet API key" step with NuGet/login@8d19675… # v1 (id: nuget-login, user: Chris-Wolfgang) — exchanges the GitHub OIDC token for an ephemeral (~1h) push key.
  • Publish step now uses --api-key ${{ steps.nuget-login.outputs.NUGET_API_KEY }} (the ephemeral step output) instead of the repo secret.
  • No secrets.NUGET_API_KEY reference remains anywhere in the file.

Canonical shape ported from Etl-DbClient's release.yaml on main.

⚠️ REQUIRED before the next release runs (manual, yours — I can't)

Configure a Trusted Publishing policy on nuget.org for BOTH packages first, or the OIDC publish fails:

  • Wolfgang.Etl.TestKit and Wolfgang.Etl.TestKit.Xunit → package page → Manage → Trusted Publishing → Add policy → owner Chris-Wolfgang, repo ETL-Test-Kit, workflow .github/workflows/release.yaml.
  • After this ships, the long-lived NUGET_API_KEY repo secret can be deleted.

Protected file

release.yaml trips the Detect .NET Projects guard — handle via the protected-file split / admin-bypass at the vNext → main stage (it joins the other workflow changes already queued there).

Closes #207 when the vNext cycle merges to main.

🤖 Generated with Claude Code

Replaces secrets.NUGET_API_KEY with NuGet Trusted Publishing: the publish-nuget
job now adds id-token: write, exchanges the GitHub OIDC token for an ephemeral
push key via NuGet/login@v1 (SHA-pinned), and publishes with that step-output
key. No long-lived API key on GitHub or NuGet.

REQUIRES (manual, before the next release runs): a Trusted Publishing policy on
nuget.org for BOTH Wolfgang.Etl.TestKit and Wolfgang.Etl.TestKit.Xunit
(owner Chris-Wolfgang, repo ETL-Test-Kit, workflow release.yaml). Unblocks the
#140 SECURITY.md OIDC release-path appendix. Canonical shape from Etl-DbClient.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings July 24, 2026 19:02

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

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