Skip to content

Commit 8211193

Browse files
authored
Fix npm publish step by adding NODE_AUTH_TOKEN
Restored NODE_AUTH_TOKEN environment variable for npm publish step.
1 parent b01018a commit 8211193

1 file changed

Lines changed: 4 additions & 9 deletions

File tree

.github/workflows/release-publish.yml

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ jobs:
3232
permissions:
3333
contents: write
3434
packages: write
35-
id-token: write # Required for npm Trusted Publishing
35+
id-token: write
3636
steps:
3737
- name: Checkout code
3838
uses: actions/checkout@v4
@@ -44,8 +44,6 @@ jobs:
4444
uses: actions/setup-node@v4
4545
with:
4646
node-version: '18.x'
47-
# This registry-url is crucial; it tells npm to use registry.npmjs.org
48-
# and prepares the .npmrc for OIDC authentication.
4947
registry-url: 'https://registry.npmjs.org'
5048

5149
- name: Setup Bun
@@ -78,9 +76,7 @@ jobs:
7876
7977
- name: Generate Changelog
8078
run: |
81-
# Generate the full changelog
8279
npm run changelog
83-
# Generate release notes for just this version
8480
npm run changelog:latest
8581
8682
- name: Build project
@@ -95,11 +91,8 @@ jobs:
9591
9692
- name: Create and push tag
9793
run: |
98-
# Delete the tag if it already exists locally
9994
git tag -d "v${{ env.VERSION }}" 2>/dev/null || true
100-
# Delete the tag if it exists on the remote
10195
git push origin --delete "v${{ env.VERSION }}" 2>/dev/null || true
102-
# Create and push the new tag
10396
git tag -a "v${{ env.VERSION }}" -m "Release v${{ env.VERSION }}"
10497
git push origin "v${{ env.VERSION }}"
10598
@@ -114,5 +107,7 @@ jobs:
114107
GITHUB_TOKEN: ${{ secrets.PAT_GITHUB }}
115108

116109
- name: Publish to npm
117-
# No env variable needed here; auth is handled by id-token and registry-url
118110
run: npm publish --access public --provenance --tag ${{ github.event.inputs.dist_tag || 'latest' }}
111+
env:
112+
# Restored the token here to ensure it works
113+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

0 commit comments

Comments
 (0)