Skip to content

Commit 8ac9ed5

Browse files
Wenxin-Jiangclaude
andcommitted
fix: use NPM_TOKEN for npm publish to support new packages
OIDC trusted publishing requires packages to already exist on the npm registry. Use NPM_TOKEN (automation token) instead, which can create new packages directly — matching how the original workflow worked. - Add `environment: npm-publish` to satisfy zizmor audit - Add `NODE_AUTH_TOKEN` from `secrets.NPM_TOKEN` for publish steps - Add `fail-fast: false` to build matrix to prevent one flaky build from cancelling all others Prerequisites: 1. Create an "npm-publish" environment in repo Settings → Environments 2. Add NPM_TOKEN secret to that environment (automation token from npmjs.com @SocketSecurity org) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent c295ef3 commit 8ac9ed5

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

.github/workflows/release.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ jobs:
5656
needs: [version, tag]
5757
if: ${{ always() && needs.version.result == 'success' && (needs.tag.result == 'success' || needs.tag.result == 'skipped') }}
5858
strategy:
59+
fail-fast: false
5960
matrix:
6061
include:
6162
- target: aarch64-apple-darwin
@@ -233,6 +234,7 @@ jobs:
233234
needs: [version, build]
234235
if: ${{ !inputs.dry-run }}
235236
runs-on: ubuntu-latest
237+
environment: npm-publish
236238
permissions:
237239
contents: read
238240
id-token: write
@@ -291,6 +293,8 @@ jobs:
291293
stage_win socket-patch-aarch64-pc-windows-msvc npm/socket-patch-win32-arm64
292294
293295
- name: Publish platform packages
296+
env:
297+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
294298
run: |
295299
for pkg_dir in npm/socket-patch-*/; do
296300
echo "Publishing ${pkg_dir}..."
@@ -304,6 +308,8 @@ jobs:
304308
run: cp README.md npm/socket-patch/README.md
305309

306310
- name: Publish main package
311+
env:
312+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
307313
run: npm publish ./npm/socket-patch --provenance --access public
308314

309315
pypi-publish:

0 commit comments

Comments
 (0)