Skip to content

Commit a9b2872

Browse files
committed
Use literal ${NPM_TOKEN} in npm auth
This is not supposed to be the token, but the literal value that is then replaced by npm. Probably does not make a difference, but the docs are clear on *not* putting a token in this file. The docs also say to put it in the project root. Also adding some lines to debug what runs.
1 parent 344df38 commit a9b2872

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

ci/steps/publish-npm.sh

+5-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,10 @@ main() {
4646

4747
# This allows us to publish to npm in CI workflows
4848
if [[ ${CI-} ]]; then
49-
echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > ~/.npmrc
49+
echo "Adding NPM_TOKEN to .npmrc"
50+
# This is meant to be the literal value of ${NPM_TOKEN}, not the actual
51+
# token itself.
52+
echo '//registry.npmjs.org/:_authToken=${NPM_TOKEN}' >> .npmrc
5053
fi
5154

5255
## Environment
@@ -142,6 +145,7 @@ main() {
142145

143146
# Since the dev builds are scoped to @coder
144147
# We pass --access public to ensure npm knows it's not private.
148+
echo "Publishing version $NPM_VERSION with tag $NPM_TAG"
145149
npm publish --non-interactive release --tag "$NPM_TAG" --access public
146150
}
147151

0 commit comments

Comments
 (0)