Repository navigation
Conversation
The release job pushed to nuget.org with NUGET_TOKEN, a long-lived API key that the ikvmnet repositories share as an organization secret. It expired on 2026-11-03 and failed an ikvm-bytecode release until it was renewed, and it will expire again. The job now gets a short-lived key from NuGet/login, which trades the job's GitHub OIDC token for a key valid for an hour, checked against the trusted publishing policy on nuget.org. The login needs the nuget.org username of the account that created that policy, which it reads from the NUGET_USER secret. Granting id-token drops every permission the job does not name, so contents and packages are named too, for the release and the GitHub Packages push.
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 release job pushes to nuget.org with
NUGET_TOKEN, a long-lived API key that the ikvmnet repositories share as an organization secret. On 2026-11-03 it expired, and the ikvm-bytecode 9.4.1 release failed with a 403 until the key was renewed. It will expire again, and when it does, every repository's next release fails the same way.What
The same change as ikvmnet/ikvm-bytecode#7:
NuGet/login@v1just before pushing. The action trades the job's GitHub OIDC token for a key that is valid for an hour, provided the token matches a trusted publishing policy on nuget.org.usercomes from a newNUGET_USERsecret: the nuget.org username of the account that created the policy. nuget.org refuses an organization name there.id-token: write. Naming any permission drops the rest, so it also namescontents: writefor the release andpackages: writefor the GitHub Packages push.Before the next release
NUGET_USERsecret to the organization, available to this repository, holding the nuget.org username (not the email address) of the account that creates the policy. One organization secret covers every repository that makes this change.ikvm-revived, with repository ownerikvmnet, repositoryikvm-reference-assemblies, workflowIKVM.ReferenceAssemblies.ymland no environment. If it ever names an environment, the release job needs a matchingenvironment:.Testing
This PR's run only checks that the workflow file is valid. The release job doesn't run for pull requests, and after merging it logs in to nuget.org only for a release tag, so the first release after this merges is the first real test.