Skip to content

Commit 107550e

Browse files
committed
ci: use npm OIDC trusted publishing (no NPM_TOKEN)
Replace static NPM_TOKEN auth with npm's OIDC trusted publishing. Requires npm >= 11.5.1 for OIDC support, so we install latest npm via actions/setup-node. Also adds repository field to package.json which npm requires for trusted publisher verification.
1 parent e9a690f commit 107550e

3 files changed

Lines changed: 19 additions & 10 deletions

File tree

.github/workflows/changesets.yml

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,16 @@ jobs:
2222
with:
2323
bun-version: latest
2424

25+
- uses: actions/setup-node@v4
26+
with:
27+
node-version: '22'
28+
29+
- name: Update npm for OIDC trusted publishing
30+
run: npm install -g npm@latest
31+
2532
- name: Install dependencies
2633
run: bun install
2734

28-
- name: Setup npm auth
29-
run: echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > .npmrc
30-
env:
31-
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
32-
3335
- name: Build
3436
run: bun run build
3537

@@ -40,4 +42,3 @@ jobs:
4042
version: bun run version
4143
env:
4244
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
43-
NPM_CONFIG_PROVENANCE: true

.github/workflows/snapshot-release.yml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,13 @@ jobs:
2121
with:
2222
bun-version: latest
2323

24+
- uses: actions/setup-node@v4
25+
with:
26+
node-version: '22'
27+
28+
- name: Update npm for OIDC trusted publishing
29+
run: npm install -g npm@latest
30+
2431
- name: Install dependencies
2532
run: bun install
2633

@@ -32,9 +39,5 @@ jobs:
3239

3340
- name: Publish snapshot to npm
3441
run: |
35-
echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > .npmrc
3642
npx changeset version --snapshot canary
3743
npx changeset publish --tag canary --no-git-tag
38-
env:
39-
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
40-
NPM_CONFIG_PROVENANCE: true

packages/agent-react-devtools/package.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,11 @@
1414
"typecheck": "tsc --noEmit",
1515
"lint": "tsc --noEmit"
1616
},
17+
"repository": {
18+
"type": "git",
19+
"url": "https://github.com/piotrski/agent-react-devtools.git",
20+
"directory": "packages/agent-react-devtools"
21+
},
1722
"license": "MIT",
1823
"devDependencies": {
1924
"@types/node": "^22.0.0",

0 commit comments

Comments
 (0)