[XAPI-2340] Switch NuGet publishing to Trusted Publishing (OIDC) - #663
Merged
Merged
Conversation
Replaces the long-lived NUGET_APIKEY secret with NuGet's Trusted Publishing flow (NuGet/login@v1 + id-token: write) for both the OAuth2 and OAuth2Client publish workflows. The OAuth2Client publish has been failing with a 403 since 2026-07-14, likely because the API key's package scope doesn't cover Xero.NetStandard.OAuth2Client; Trusted Publishing removes the scoping problem and the long-lived secret entirely.
the-chris-mitchell
force-pushed
the
xapi-2340-nuget-trusted-publishing
branch
from
August 10, 2026 03:31
fdabf81 to
b0186d1
Compare
the-chris-mitchell
marked this pull request as ready for review
August 10, 2026 03:34
3 tasks
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.
Summary
publish-Oauth2-package.ymlandpublish-Oauth2Client-package.ymlfrom the long-livedNUGET_APIKEYsecret to NuGet Trusted Publishing (OIDC-based, short-lived keys), usingNuGet/login@v1.Xero.NetStandard.OAuth2Client. Trusted Publishing removes the recurring scoping problem and the long-lived secret entirely.Before this can be merged/run successfully
NUGET_USER(Settings → Secrets and variables → Actions → Variables) set to the nuget.org profile name (not email) that owns these packages.XeroAPI/Xero-NetStandard, Workflow file:publish-Oauth2-package.yml, Environment:prodXeroAPI/Xero-NetStandard, Workflow file:publish-Oauth2Client-package.yml, Environment:prodNUGET_APIKEYsecret can be removed (kept for now in case of rollback).Test plan
NUGET_USERrepo variable setprod)Publish OAuth2Client Packagevia workflow_dispatch and confirm theNuGet loginstep succeeds and push completesPublish OAuth2 Packagevia workflow_dispatch and confirm the sameJira: https://xero.atlassian.net/browse/XAPI-2340
🤖 Generated with Claude Code