Skip to content

Commit c2f12c5

Browse files
authored
chore: npm publish CI workflow to OIDC trusted publishing (#1372)
Due to `npm` token deprecation (announced December 9th, 2025), classic tokens have been revoked and temporary granular tokens expired on February 17th, 2026. This change migrates to npm Trusted Publishing which uses OpenID Connect (OIDC) for authentication, eliminating the need for long-lived tokens.
1 parent f201861 commit c2f12c5

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

.github/workflows/publish-on-merge.yaml

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,21 +5,25 @@ on:
55
branches: [master]
66
paths: ['packages/*/package.json']
77

8+
permissions:
9+
id-token: write # Required for OIDC trusted publishing
10+
contents: write
11+
812
jobs:
913
build-and-publish:
1014
if: 'contains(github.event.head_commit.message, ''chore(release): publish new package versions'')'
1115
runs-on: ubuntu-latest
1216
environment: CD
13-
permissions:
14-
contents: write
1517

1618
steps:
1719
- uses: actions/checkout@v4
1820
with:
1921
token: ${{ secrets.GITHUB_TOKEN }}
22+
2023
- uses: actions/setup-node@v4
2124
with:
22-
node-version: '22'
25+
node-version: '24'
26+
registry-url: 'https://registry.npmjs.org'
2327

2428
- name: Configure Git
2529
run: |
@@ -32,11 +36,6 @@ jobs:
3236
- name: Build packages
3337
run: yarn build
3438

35-
- name: Configure NPM
36-
run: echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> .npmrc
37-
env:
38-
NPM_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }}
39-
4039
- name: Publish to NPM
4140
env:
4241
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)