From 60f8bca0fad42453325adc3299aac6453b866337 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20MANSUY?= Date: Tue, 14 Apr 2026 00:28:58 +0800 Subject: [PATCH] fix: write GitHub Packages auth to NPM_CONFIG_USERCONFIG not ~/.npmrc actions/setup-node sets NPM_CONFIG_USERCONFIG to a temp file; appending the @raphaelmansuy scope and GitHub Packages token to ~/.npmrc was being ignored, causing ENEEDAUTH on every GitHub Packages publish step. --- .github/workflows/release-wasm.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release-wasm.yml b/.github/workflows/release-wasm.yml index 3fcfea7..759a109 100644 --- a/.github/workflows/release-wasm.yml +++ b/.github/workflows/release-wasm.yml @@ -178,8 +178,11 @@ jobs: fs.writeFileSync(pkgPath, JSON.stringify(pkg, null, 2) + '\n'); " # Write a scoped .npmrc so npm uses the right registry for this scope. - echo "@raphaelmansuy:registry=https://npm.pkg.github.com" >> ~/.npmrc - echo "//npm.pkg.github.com/:_authToken=${NODE_AUTH_TOKEN}" >> ~/.npmrc + # actions/setup-node sets NPM_CONFIG_USERCONFIG to a temp file; append there, + # not to ~/.npmrc, so npm actually picks up the GitHub Packages token. + NPMRC="${NPM_CONFIG_USERCONFIG:-$HOME/.npmrc}" + echo "@raphaelmansuy:registry=https://npm.pkg.github.com" >> "$NPMRC" + echo "//npm.pkg.github.com/:_authToken=${NODE_AUTH_TOKEN}" >> "$NPMRC" cd crates/edgeparse-wasm/pkg npm publish --registry https://npm.pkg.github.com \ || { CODE=$?; echo "GitHub Packages publish exited $CODE — may already exist for this version." ; }