Publish the directory, not the GitHub repo of the same name - #11
Merged
Conversation
`npm publish npm/cli` does not publish this repository's npm/cli directory. npm reads the argument as a package spec, and `<a>/<b>` is the GitHub shorthand, so npm clones github.com/npm/cli and packs the npm CLI itself. The loop's first iteration, `npm/darwin-arm64`, names a repository that does not exist, so the release would have died on `git ls-remote ... Permission denied (publickey)` -- an error that reads like an auth problem with our own registry and says nothing about a path. Only a spec starting with `.`, `/` or `~/` is read as a directory. Reproduced on npm 11.19.0, the version release.yml installs: the bare form packs `npm@12.0.2`, the `./` form packs `@reachpad/cli@0.4.1` with its four files. Same fix in npm/README.md's by-hand loop, which had the same bug. The new test parses both files rather than restating the command, so a future publish line has to be a path too. It fails on the pre-fix workflow. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01CBLfBLaR2Z3oWEhb4FcGnT Greentree-Change-Id: 9f8303ecee1b51f439d184cdd18dedf6
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.
npm publish npm/clidoes not publish this repository'snpm/clidirectory. npm reads a publish argument as a package spec, and<a>/<b>is the GitHub shorthand — so npm clonesgithub.com/npm/cliand packs the npm CLI itself. The loop's first iteration,npm/darwin-arm64, names a repository that does not exist, so a release would have died on:which reads like an auth problem with our own registry and says nothing about a path. Only a spec starting with
.,/or~/is read as a directory.Reproduced on npm 11.19.0, the version
release.ymlinstalls:npm publish "npm/cli"npm@12.0.2(the npm CLI, from GitHub)npm publish "./npm/cli"@reachpad/cli@0.4.1, 4 filesThis is the second half of the reason nothing has ever been published by the workflow. #10 fixed the test-order failure that killed the
npmjob two steps early oncli-v0.4.0; this is what the job would have hit next. The by-hand loop innpm/README.mdhad the same bug.The new test parses
release.ymlandnpm/README.mdrather than restating the command, so a future publish line has to name a path too. Verified failing on the pre-fix workflow, passing after.Still open before a tag publishes on its own: the trusted publisher must be configured for each of the five packages at npmjs.com (they now exist, so it can be).