File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1919 uses : actions/setup-node@v4
2020 with :
2121 node-version : ' 20'
22+ registry-url : ' https://registry.npmjs.org'
2223
2324 - name : Install dependencies
2425 run : yarn install
@@ -30,11 +31,15 @@ jobs:
3031 # It will only publish if the version in package.json is new
3132 # Note: Trusted Publishing requires permissions: id-token: write
3233 run : |
33- echo "registry=https://registry.npmjs.org/" > .npmrc
34+ # setup-node creates an .npmrc with an empty token which breaks Trusted Publishing
35+ # We need to remove it but keep the registry configuration
36+ rm -f .npmrc
37+ npm config set registry https://registry.npmjs.org/
38+
3439 PACKAGE_NAME=$(node -p "require('./package.json').name")
3540 PACKAGE_VERSION=$(node -p "require('./package.json').version")
3641 if npm view "$PACKAGE_NAME" version | grep -q "$PACKAGE_VERSION"; then
3742 echo "Version $PACKAGE_VERSION already exists on NPM. Skipping publish."
3843 else
39- npm publish --provenance --access public --verbose --registry https://registry.npmjs.org/
44+ npm publish --provenance --access public --verbose
4045 fi
You can’t perform that action at this time.
0 commit comments