Skip to content

Commit 7a16791

Browse files
committed
fix: 使用组织级别的 NPM_AUTH_TOKEN secret
- 更新 publish.yml 使用 NPM_AUTH_TOKEN 而非 NPM_TOKEN - 更新文档说明组织已配置 Organization Secret - 简化配置流程,无需重复配置
1 parent ee4b859 commit 7a16791

File tree

3 files changed

+10
-5
lines changed

3 files changed

+10
-5
lines changed

.github/SETUP.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,15 @@
1515

1616
### 在 GitHub 中配置
1717

18+
**注意**: 如果你的组织已经配置了 Organization Secret `NPM_AUTH_TOKEN`,可以跳过此步骤。
19+
20+
如果需要为单个仓库配置:
21+
1822
1. 打开仓库页面:https://github.com/realsee-developer/vreo
1923
2. 进入 **Settings****Secrets and variables****Actions**
2024
3. 点击 **New repository secret**
2125
4. 配置如下:
22-
- Name: `NPM_TOKEN`
26+
- Name: `NPM_AUTH_TOKEN`
2327
- Secret: 粘贴你的 npm token
2428
5. 点击 **Add secret**
2529

@@ -140,7 +144,7 @@ README 中已经添加了以下徽章:
140144

141145
### Q: 发布失败,显示 "Invalid authentication token"
142146

143-
A: 检查 NPM_TOKEN 是否正确配置,token 是否过期。
147+
A: 检查 NPM_AUTH_TOKEN 是否正确配置(组织或仓库级别),token 是否过期。
144148

145149
### Q: GitHub Pages 部署失败
146150

.github/workflows/publish.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ jobs:
5858
cd packages/vreo
5959
npm publish --tag ${{ steps.npm-tag.outputs.tag }} --access public
6060
env:
61-
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
61+
NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
6262

6363
- name: Read CHANGELOG
6464
id: changelog

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -149,9 +149,10 @@ git push origin --tags
149149

150150
### 配置要求
151151

152-
发布到 npm 需要在仓库设置中配置
152+
发布到 npm 需要在组织或仓库级别配置
153153
- **Settings → Secrets and variables → Actions**
154-
- 添加 `NPM_TOKEN` secret(从 npmjs.com 获取访问令牌)
154+
- 添加 `NPM_AUTH_TOKEN` secret(从 npmjs.com 获取访问令牌)
155+
- 如果组织已配置 Organization Secret,可跳过此步骤
155156

156157
GitHub Pages 需要启用:
157158
- **Settings → Pages → Source**: GitHub Actions

0 commit comments

Comments
 (0)