Skip to content

Commit afbc5fb

Browse files
committed
fix: upgrade npm in CI to 11.x for OIDC trusted publishing support
Made-with: Cursor
1 parent bdbfeaf commit afbc5fb

1 file changed

Lines changed: 5 additions & 7 deletions

File tree

.github/workflows/release.yml

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@ jobs:
2020
- uses: actions/setup-node@v4
2121
with:
2222
node-version: 20
23-
# No registry-url here — setup-node's auth token wiring conflicts
24-
# with OIDC trusted publishing. npm detects the GitHub OIDC environment
25-
# automatically when NODE_AUTH_TOKEN is absent.
23+
24+
- name: Upgrade npm to support trusted publishing
25+
run: npm install -g npm@latest
2626

2727
- name: Install dependencies
2828
run: npm install
@@ -34,12 +34,10 @@ jobs:
3434
run: |
3535
PACKAGE_NAME=$(node -e "console.log(require('./package.json').name)")
3636
CURRENT=$(node -e "console.log(require('./package.json').version)")
37-
PUBLISHED=$(npm view "$PACKAGE_NAME" version 2>/dev/null || echo "0.0.0")
37+
PUBLISHED=$(npm view "$PACKAGE_NAME" version --registry https://registry.npmjs.org 2>/dev/null || echo "0.0.0")
3838
if [ "$CURRENT" != "$PUBLISHED" ]; then
3939
echo "Publishing $PACKAGE_NAME@$CURRENT (was $PUBLISHED on npm)"
40-
npm publish --access public --provenance
40+
npm publish --access public --provenance --registry https://registry.npmjs.org
4141
else
4242
echo "Version $CURRENT already published, skipping"
4343
fi
44-
env:
45-
NPM_CONFIG_REGISTRY: https://registry.npmjs.org/

0 commit comments

Comments
 (0)