File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 3232 permissions :
3333 contents : write
3434 packages : write
35- id-token : write
35+ id-token : write # Required for npm Trusted Publishing
3636 steps :
3737 - name : Checkout code
3838 uses : actions/checkout@v4
4444 uses : actions/setup-node@v4
4545 with :
4646 node-version : ' 18.x'
47+ # This registry-url is crucial; it tells npm to use registry.npmjs.org
48+ # and prepares the .npmrc for OIDC authentication.
4749 registry-url : ' https://registry.npmjs.org'
4850
4951 - name : Setup Bun
@@ -112,6 +114,5 @@ jobs:
112114 GITHUB_TOKEN : ${{ secrets.PAT_GITHUB }}
113115
114116 - name : Publish to npm
117+ # No env variable needed here; auth is handled by id-token and registry-url
115118 run : npm publish --access public --provenance --tag ${{ github.event.inputs.dist_tag || 'latest' }}
116- env :
117- NODE_AUTH_TOKEN : ${{ secrets.NPM_TOKEN }}
You can’t perform that action at this time.
0 commit comments