Skip to content

Commit d2d5ad0

Browse files
committed
fix: add npm authentication configuration for semantic-release
- Create .npmrc file with NPM_TOKEN before running semantic-release - Add NODE_AUTH_TOKEN environment variable - Ensures npm authentication works properly
1 parent e8df4ec commit d2d5ad0

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

.github/workflows/release.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,12 +43,19 @@ jobs:
4343
- name: Build application
4444
run: pnpm run build
4545

46+
- name: Configure npm authentication
47+
env:
48+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
49+
run: |
50+
echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > ~/.npmrc
51+
4652
- name: Run semantic-release
4753
id: semantic
4854
env:
4955
GITHUB_TOKEN: ${{ secrets.GH_TOKEN || secrets.GITHUB_TOKEN }}
5056
GH_TOKEN: ${{ secrets.GH_TOKEN || secrets.GITHUB_TOKEN }}
5157
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
58+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
5259
run: |
5360
# Run semantic-release to handle versioning and changelog
5461
npx semantic-release

0 commit comments

Comments
 (0)