Skip to content

Commit 0d99e71

Browse files
committed
ci: fix oidc
1 parent edb4afe commit 0d99e71

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

.github/workflows/publish.yaml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,13 @@ jobs:
2222

2323
- name: Setup bun
2424
uses: oven-sh/setup-bun@v1 # Uncomment this if you're using Bun
25+
- name: Setup Node.js for OIDC
26+
uses: actions/setup-node@v4
27+
with:
28+
# 必须指定 >=20 的 Node.js 版本,以确保 npm >= 11.5 支持 OIDC
29+
node-version: "20.x"
30+
# 这是 OIDC 发布的核心配置,告诉 npm 使用 GitHub OIDC 令牌
31+
registry-url: "https://registry.npmjs.org"
2532
# 安装依赖
2633
- name: Install dependencies
2734
run: bun install
@@ -38,4 +45,4 @@ jobs:
3845
# NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
3946
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4047
# NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
41-
npm_config_registry: https://registry.npmjs.org
48+
# npm_config_registry: https://registry.npmjs.org

0 commit comments

Comments
 (0)