Skip to content

Chore/trusted publishing - #39

Merged
kieronlanning merged 2 commits into
mainfrom
chore/trusted-publishing
Nov 2, 2026
Merged

kieronlanning merged 2 commits into
mainfrom
chore/trusted-publishing

Conversation

@kieronlanning

Copy link
Copy Markdown
Contributor

No description provided.

nuget.org validates the OIDC `job_workflow_ref` claim against the registered
Trusted Publishing policy. Inside a reusable workflow that claim names the
called repository, never the caller, so a policy registered for the caller can
never match and the exchange fails with "No matching trust policy"
(NuGet/NuGetGallery#11000, still open).

Move the whole release job into `actions/purview-release`, a composite action
that runs in the caller's own job, and reduce `purview-release.yml` to a
delegator that forwards to it for older callers. The delegator no longer
accepts `trusted-publishing` or `nuget-user`: offering an input that always
401s only invites a broken migration.

This repository's own release workflow mints its nuget.org key the same way.

Also fix a latent bug: GitHub evaluates the empty string as falsy, so
`condition && '' || legacyKey` yields `legacyKey`, and the leftover secret was
never blanked. The credential is now chosen in the shell script.

BREAKING CHANGE: `purview-release.yml` no longer accepts `trusted-publishing`
or `nuget-user`. Trusted Publishing requires calling
`purview-dev/build/actions/purview-release` from the consuming repository's own
job, which is the workflow file the nuget.org policy names.
@kieronlanning
kieronlanning merged commit e49e26c into main Nov 2, 2026
1 check passed
@kieronlanning
kieronlanning deleted the chore/trusted-publishing branch November 2, 2026 22:49
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