From cc6c51bde6f668cc8e61b554a92014ad00587918 Mon Sep 17 00:00:00 2001 From: Tony Powell Date: Mon, 30 Dec 2024 14:00:24 -0500 Subject: [PATCH] Don't mutate .npmrc during publish action --- .github/workflows/changesets.yml | 8 ++++++-- package.json | 2 +- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/.github/workflows/changesets.yml b/.github/workflows/changesets.yml index ba9ee5ce..8e3c1356 100644 --- a/.github/workflows/changesets.yml +++ b/.github/workflows/changesets.yml @@ -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: @@ -44,4 +49,3 @@ jobs: NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} NPM_TOKEN: ${{ secrets.NPM_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - HOME: ${{ github.workspace }} diff --git a/package.json b/package.json index 8fd749ce..e035808c 100644 --- a/package.json +++ b/package.json @@ -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": {