Skip to content

Commit cc6c51b

Browse files
committed
Don't mutate .npmrc during publish action
1 parent 6d4210d commit cc6c51b

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

.github/workflows/changesets.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,12 @@ jobs:
3232
- name: install dependencies
3333
run: pnpm install
3434
- name: Setup npmrc
35-
run: echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > .npmrc
35+
# cp .npmrc to $HOME, append authToken to .npmrc
36+
# changeset will use the .npmrc in $HOME, and writing there instead of in the repo
37+
# prevents pnpm from complaining about a dirty worktree
38+
run: |
39+
cp .npmrc $HOME
40+
echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" >> $HOME/.npmrc
3641
- name: create and publish versions
3742
uses: changesets/action@v1
3843
with:
@@ -44,4 +49,3 @@ jobs:
4449
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
4550
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
4651
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
47-
HOME: ${{ github.workspace }}

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
"storybook": "storybook dev -p 6006",
3636
"build-storybook": "storybook build",
3737
"chromatic": "npx chromatic --project-token=46df7a59e0a8",
38-
"ci:publish": "pnpm publish -r",
38+
"ci:publish": "pnpm publish",
3939
"ci:version": "pnpm changeset version"
4040
},
4141
"peerDependencies": {

0 commit comments

Comments
 (0)