Skip to content

Commit bcbd063

Browse files
Wenxin-Jiangclaude
andcommitted
fix: restore NPM_TOKEN with environment for new package publishing
OIDC trusted publishing doesn't work for brand new packages that don't exist on the npm registry yet. The new -gnu/-musl packages need NPM_TOKEN for their first publish. Added `environment: npm-publish` to satisfy zizmor's secrets-outside-env audit. The environment needs to be created in the repo settings with the NPM_TOKEN secret. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 98e404f commit bcbd063

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

.github/workflows/release.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -233,6 +233,7 @@ jobs:
233233
needs: [version, build]
234234
if: ${{ !inputs.dry-run }}
235235
runs-on: ubuntu-latest
236+
environment: npm-publish
236237
permissions:
237238
contents: read
238239
id-token: write
@@ -291,6 +292,8 @@ jobs:
291292
stage_win socket-patch-aarch64-pc-windows-msvc npm/socket-patch-win32-arm64
292293
293294
- name: Publish platform packages
295+
env:
296+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
294297
run: |
295298
for pkg_dir in npm/socket-patch-*/; do
296299
echo "Publishing ${pkg_dir}..."
@@ -304,6 +307,8 @@ jobs:
304307
run: cp README.md npm/socket-patch/README.md
305308

306309
- name: Publish main package
310+
env:
311+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
307312
run: npm publish ./npm/socket-patch --provenance --access public
308313

309314
pypi-publish:

0 commit comments

Comments
 (0)