Skip to content

Commit 044c967

Browse files
authored
chore: add NPM token config without corrupting .npmrc
OK, this was pretty funny in the end. The base `.npmrc` didn't have a trailing line break, so this command: ``` echo '//registry.npmjs.org/:_authToken=${NPM_TOKEN}' >> .npmrc ``` Turned the file into this: ``` auto-install-peers=true workspaces-update=false//registry.npmjs.org/:_authToken=${NPM_TOKEN} ``` That explains both why: 1. The auth didn't work. 2. The workspace refs stopped updating. The solution herein is to add a preceding line break, unconditionally.
1 parent 093f058 commit 044c967

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

.github/workflows/cicd.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ jobs:
5050

5151
- name: Publish NPM
5252
run: |
53-
echo '//registry.npmjs.org/:_authToken=${NPM_TOKEN}' >> .npmrc
53+
echo $'\n//registry.npmjs.org/:_authToken=${NPM_TOKEN}' >> .npmrc
5454
pnpm publish-packages
5555
env:
5656
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)