fix: release-npm workflow checkout and npm publish token#112
Merged
Conversation
The npm/ directory was added after the 0.9.11 release tag, so checking out at the release ref caused a missing working directory error. The workflow only needs the scripts from the default branch; binaries are downloaded from the specified release version by the script itself. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
The npm token with publish access to @icp-sdk is stored in the release GitHub environment, not as a repo-level secret. Without this declaration the job used a narrower-scoped token that could not create new packages. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
adamspofford-dfinity
approved these changes
May 12, 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.
SDK-2707
Summary
Two bugs prevented the first npm publish from succeeding:
Missing
npm/directory at release tag — the workflow checked out atref: ${{ inputs.version }}, but thenpm/directory was introduced after the0.9.11release tag. The workflow only needs scripts from the default branch (binaries are downloaded from the specified release), so therefpin is removed.Missing
releaseGitHub environment —npm publish --provenancerequires an npm token with publish access to@icp-sdk. This repo does not have thereleaseenvironment set up yet, which is the organizational convention for trusted publishing to npm. The workflow fell back to a narrower-scoped repo-level token that returned 404 when trying to create new packages. Addingenvironment: releaseto the workflow job declares the dependency; the environment itself still needs to be created (see Prerequisites below).Prerequisites (action required before merging)
releaseenvironment in this repo's GitHub settings following the organizational convention for trusted publishing to npm.Test plan
0.9.11after thereleaseenvironment is set up, to verify the full publish succeeds end-to-end.