Repository navigation
ci(sdk): publish to NuGet with trusted publishing (OIDC), not the static API key - #131
Merged
Merged
Conversation
…tic API key The trust policy on nuget.org was never used: build-release-sdk.yml had no `id-token: write` permission and no NuGet/login step, so every release pushed with `secrets.NUGET_API_KEY` — a key created 2026-05-29 that now returns 403 "The specified API key has expired". Konnektr.AgeDigitalTwins has therefore not been published since 1.30.0 (1.30.1 and 1.31.0 shipped images but no package). Mint a short-lived key from the GitHub OIDC token instead. `user` comes from the repo variable NUGET_USER (the profile of the trust-policy creator, not the owning org, which the login step rejects). Refs #129 Co-authored-by: Hermes Agent <hermes@nikoraes.local>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why the SDK has not published since 1.30.0
The trust policy on nuget.org was never invoked.
build-release-sdk.ymlonmaincontains noNuGet/loginstep and noid-token: writepermission — a repo-wide code search forid-tokenandNuGet/loginreturns 0 hits. Every release therefore pushed withsecrets.NUGET_API_KEY:That key was set 2026-05-29 and now answers
403 The specified API key has expired, soKonnektr.AgeDigitalTwinsstops at 1.30.0 while 1.30.1 and 1.31.0 shipped images only. A trust policy with no token request is inert — nothing was misconfigured on nuget.org, the workflow just never asked.The change
vars.NUGET_USER(set tonikoraes) must be the nuget.org profile of the trust-policy creator, not the owning orgKonnektr— the login step rejects the org with "No matching trust policy owned by user '…' was found". The minted key is valid for one hour and single-use, so the login sits immediately before the push;Build/Packstay unauthenticated.Verification
This is a
release-triggered workflow, so a fix onmaindoes not apply to an existing release: thereleaseevent runs the workflow from the tag's tree. After merging, v1.31.0's tag is re-cut onto this commit (safe: 1.31.0 was never published to NuGet, and a workflow file is not inside the.nupkg) so the release run picks up the login step. Expected:NuGet logingreen →Push to NuGetgreen →1.31.0resolvable on the flat-container index.If the trust policy names a different workflow file than
build-release-sdk.yml, the login step fails 401 and names the mismatch — I will report that rather than guess.— Hermes