Skip to content

Commit b421997

Browse files
committed
ci: github action as trusted publisher removes token
1 parent e4f6233 commit b421997

File tree

2 files changed

+22
-10
lines changed

2 files changed

+22
-10
lines changed

.github/workflows/release.yml

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
name: Release
22

3+
permissions:
4+
id-token: write
5+
contents: read
6+
37
on:
48
workflow_dispatch: ~
59
push:
@@ -22,8 +26,9 @@ jobs:
2226
- name: Setup Node
2327
uses: actions/setup-node@v4
2428
with:
25-
node-version: 22
29+
node-version: "current"
2630
cache: "pnpm"
31+
registry-url: "https://registry.npmjs.org"
2732

2833
- name: Install dependencies
2934
run: pnpm install --frozen-lockfile
@@ -40,7 +45,19 @@ jobs:
4045
- name: Build
4146
run: pnpm build
4247

48+
- name: Debug auth config
49+
run: |
50+
echo "NODE_AUTH_TOKEN is set: ${{ env.NODE_AUTH_TOKEN != '' }}"
51+
echo "NPM_TOKEN is set: ${{ env.NPM_TOKEN != '' }}"
52+
echo "npm whoami:"
53+
npm whoami 2>&1 || true
54+
echo "npmrc contents (tokens redacted):"
55+
cat ~/.npmrc 2>/dev/null | sed 's/_authToken=.*/_authToken=REDACTED/' || echo "no ~/.npmrc"
56+
cat .npmrc 2>/dev/null | sed 's/_authToken=.*/_authToken=REDACTED/' || echo "no .npmrc"
57+
58+
- name: Upgrade npm
59+
run: npm install -g npm@latest
60+
4361
- name: Publish to npm
44-
run: pnpm publish --no-git-checks
45-
env:
46-
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
62+
run: |
63+
npm publish

package.json

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -76,19 +76,14 @@
7676
"typescript": "^5.8.3",
7777
"vitest": "^3.2.4"
7878
},
79-
"packageManager": "pnpm@10.13.1+sha512.37ebf1a5c7a30d5fabe0c5df44ee8da4c965ca0c5af3dbab28c3a1681b70a256218d05c81c9c0dcf767ef6b8551eb5b960042b9ed4300c59242336377e01cfad",
79+
"packageManager": "pnpm@10.29.1",
8080
"engines": {
8181
"node": ">= 20"
8282
},
8383
"publishConfig": {
8484
"access": "public"
8585
},
8686
"devEngines": {
87-
"packageManager": {
88-
"name": "pnpm",
89-
"version": ">= 10.0.0",
90-
"onFail": "download"
91-
},
9287
"runtime": {
9388
"name": "node",
9489
"version": ">= 20"

0 commit comments

Comments
 (0)