Repository navigation
Switch NuGet.org publishing to Trusted Publishing (OIDC) - #835
Merged
Merged
Conversation
Replace the NUGET_PACKAGE_PUSH_TOKEN API key secret with a short-lived key obtained via NuGet/login. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Sergio0694
marked this pull request as ready for review
December 3, 2026 22:12
Member
|
Seems pretty good, we should make sure the other maintainers know that this needs to be applied elsewhere. Looks like MAUI switched already. 😅 |
michael-hawker
approved these changes
Dec 3, 2026
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.
Agent assessment
Self-reported assessment, not an independent review.
Assessed revision:
3a1e5869a3bf05334cdece8fedb7834b39cdfe55v1commit SHA;NUGET_API_KEYoutput name confirmed in action source.↑ Independent review found no blocking issues; workflow YAML parses.
↓ Not executed end-to-end: needs the
NUGET_USERsecret and a real release run.↓ Tag-triggered runs being accepted by the nuget.org policy is unconfirmed from the docs.
Summary
Replaces the deprecated long-lived
NUGET_PACKAGE_PUSH_TOKENAPI key with NuGet Trusted Publishing in thereleasejob of.github/workflows/build.yml:permissions: id-token: write(+contents: read).NuGet/loginstep (pinned to thev1commit SHA) that exchanges the OIDC token for a short-lived API key, usingsecrets.NUGET_USER.steps.login.outputs.NUGET_API_KEYviaenv.Azure DevOps feed pushes and the
tooling/submodule are untouched.Before merging
CommunityToolkit.*packages, Workflow File isbuild.yml, Environment isnuget-release-gate(or empty), and the package scope allows new packages and new versions (Labs ships new package IDs often, including the winui 0 leg).NUGET_USERsecret (nuget.org profile name of the policy creator, not email; consider a shared/bot account) on the repo or thenuget-release-gateenvironment.refs/tags/...) andrel/*branches, and each run uses thebuild.ymlfrom its own ref, so backport this change to any activerel/*branches. Verify on the first run that tag-triggered runs are accepted by the policy (not confirmed from the docs). Note that creating a release with a new tag can fire bothpush: tagsandrelease: publishedruns.NUGET_PACKAGE_PUSH_TOKENsecret and revoke the PAT on nuget.org..nupkgwith--skip-duplicate.