Skip to content

Commit 44717de

Browse files
punitaraniclaude
andauthored
fix(ci): publish npm tarball via ./-prefixed local path (#182)
`npm publish dist-tarball/fli-X.Y.Z.tgz` failed with a git error: npm error command git ... ls-remote ssh://git@github.com/dist-tarball/fli-0.0.1.tgz.git npm error git@github.com: Permission denied (publickey). npm's arg parser treats a bare path containing exactly one slash (and no leading ./) as a GitHub `owner/repo` shorthand, so it tried to git-clone `dist-tarball/fli-0.0.1.tgz` instead of publishing the local tarball. Prefixing with `./` forces npm to classify it as a file path. Co-authored-by: Claude <noreply@anthropic.com>
1 parent 67df384 commit 44717de

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

.github/workflows/publish-npm.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -169,5 +169,8 @@ jobs:
169169
echo "::error::No tarball found in dist-tarball/"
170170
exit 1
171171
fi
172-
echo "Publishing ${tarball}"
173-
npm publish "${tarball}" --provenance --access public
172+
# `npm publish <path>` treats a bare one-slash path like
173+
# `dist-tarball/foo.tgz` as a GitHub owner/repo shorthand and tries to
174+
# git-clone it. The leading `./` forces npm to treat it as a local tarball.
175+
echo "Publishing ./${tarball}"
176+
npm publish "./${tarball}" --provenance --access public

0 commit comments

Comments
 (0)