Skip to content

Commit

Permalink
Don't mutate .npmrc during publish action (#42)
Browse files Browse the repository at this point in the history
  • Loading branch information
cephalization authored Dec 30, 2024
1 parent 6d4210d commit a1fcae0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
8 changes: 6 additions & 2 deletions .github/workflows/changesets.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,12 @@ jobs:
- name: install dependencies
run: pnpm install
- name: Setup npmrc
run: echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > .npmrc
# cp .npmrc to $HOME, append authToken to .npmrc
# changeset will use the .npmrc in $HOME, and writing there instead of in the repo
# prevents pnpm from complaining about a dirty worktree
run: |
cp .npmrc $HOME
echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" >> $HOME/.npmrc
- name: create and publish versions
uses: changesets/action@v1
with:
Expand All @@ -44,4 +49,3 @@ jobs:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
HOME: ${{ github.workspace }}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
"storybook": "storybook dev -p 6006",
"build-storybook": "storybook build",
"chromatic": "npx chromatic --project-token=46df7a59e0a8",
"ci:publish": "pnpm publish -r",
"ci:publish": "pnpm publish",
"ci:version": "pnpm changeset version"
},
"peerDependencies": {
Expand Down

0 comments on commit a1fcae0

Please sign in to comment.