-
Notifications
You must be signed in to change notification settings - Fork 46
feat: migrate npm publish to OIDC authentication #2381
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -7,6 +7,10 @@ on: | |
| branches: | ||
| - main | ||
|
|
||
| permissions: | ||
| id-token: write | ||
| contents: write | ||
|
|
||
| jobs: | ||
| publish: | ||
| if: | ||
|
|
@@ -37,15 +41,11 @@ jobs: | |
| if: ${{ github.event.pull_request.head.ref == 'prepare-release' }} | ||
| run: | | ||
| pnpm release | ||
| env: | ||
| NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | ||
|
|
||
| - name: Publish prerelease to npm | ||
| if: ${{ github.event.pull_request.head.ref == 'prepare-prerelease' }} | ||
| run: | | ||
| pnpm release:prerelease | ||
|
Comment on lines
40
to
48
|
||
| env: | ||
| NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | ||
|
|
||
| - name: Extract changelog for version | ||
| id: get_changelog | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Repo workflows consistently scope
permissionsat the job level (e.g.docs-sync.yml,release-dispatch.yml,claude.yml), but this workflow sets them at the top level. Keepingid-token: writescoped to just the publishing job reduces blast radius if more jobs are added later; consider moving thispermissionsblock underjobs.publish.permissions(and defaulting workflow permissions to read).