Skip to content

Commit a623dbc

Browse files
authored
ci(release): publish to npm via OIDC trusted publishing (#158)
Drops the NPM_TOKEN secret from the publish step. Yarn 4.10.3 mints a short-lived npm credential from the Actions ID token when no npmAuthToken is configured, so the existing `yarn npm publish --provenance` call keeps working unchanged.
1 parent 3daf50d commit a623dbc

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

.github/workflows/release-publish.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# Publishes to npm via OIDC trusted publishing, not a token.
2+
# Each package must list this repo and this workflow file as a Trusted
3+
# Publisher on npmjs.org, or the publish step fails to authenticate.
14
name: Publish Release
25

36
on:
@@ -29,7 +32,7 @@ jobs:
2932

3033
permissions:
3134
contents: write # push the version tag
32-
id-token: write # npm provenance
35+
id-token: write # mint the npm OIDC credential and the provenance statement
3336

3437
steps:
3538
- name: Get github app token
@@ -156,9 +159,6 @@ jobs:
156159
fi
157160
158161
- name: Publish to npm
159-
env:
160-
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
161162
run: |
162-
yarn config set npmAuthToken "$NPM_TOKEN"
163163
cd packages/${{ steps.pkg.outputs.dir }}
164164
yarn npm publish --access public --provenance --tag ${{ steps.pkg.outputs.dist_tag }}

0 commit comments

Comments
 (0)