File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 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/
You can’t perform that action at this time.
0 commit comments