File tree Expand file tree Collapse file tree 1 file changed +7
-10
lines changed
Expand file tree Collapse file tree 1 file changed +7
-10
lines changed Original file line number Diff line number Diff line change @@ -178,19 +178,16 @@ jobs:
178178 exit 1
179179 fi
180180
181- - name : Publish npm
181+ - name : Publish npm (Trusted publishing)
182182 run : |
183- echo "//registry.npmjs.org/:_authToken=${NODE_AUTH_TOKEN}" > ~/.npmrc
184-
185- if [ -z "${{ secrets.NPM_TOKEN }}" ]; then
186- echo "NPM_TOKEN not set, performing dry run"
187- pnpm publish --dry-run --no-git-checks --access public
183+ if [ "${{ secrets[format('{0}', 'NPM_PUBLISH')] }}" = "yes" ]; then
184+ echo "NPM_PUBLISH=yes, publishing to npm with trusted publishing..."
185+ pnpm publish --no-git-checks --access public --provenance
188186 else
189- echo "Publishing to npm... "
190- pnpm publish --no-git-checks --access public
187+ echo "NPM_PUBLISH is not yes, performing dry run "
188+ pnpm publish --dry-run -- no-git-checks --access public
191189 fi
192- env :
193- NODE_AUTH_TOKEN : ${{ secrets.NPM_TOKEN }}
194190
195191permissions :
196192 contents : write
193+ id-token : write
You can’t perform that action at this time.
0 commit comments