Skip to content

Commit ac8c568

Browse files
authored
fix: github token to personal (#5)
1 parent e469584 commit ac8c568

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

.github/workflows/node-release.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ on:
66
NPM_TOKEN:
77
description: 'npm token'
88
required: true
9+
GIT_TOKEN:
10+
description: 'github personal token'
11+
required: true
912

1013
inputs:
1114
checkTest:
@@ -48,7 +51,7 @@ jobs:
4851
uses: actions/checkout@v3
4952
with:
5053
path: main_repo
51-
persist-credentials: false
54+
token: ${{ secrets.GIT_TOKEN }}
5255

5356
# Setup Node.js environment
5457
- name: Setup Node.js

README.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,12 +88,16 @@ jobs:
8888

8989
### 配置方式
9090

91-
- 创建 Token
91+
- 创建 NPM Token
9292
- NPM Registry 需创建 Automation Token,参见[文档](https://docs.npmjs.com/creating-and-viewing-access-tokens)
9393
- GitHub Package 无需创建,默认支持
9494

95+
- 创建 GitHub Token
96+
- 因为生成的 CHANGELOG.md 和 package.json 需回写 GitHub,而默认的 `GITHUB_TOKEN` 没有该权限
97+
- 因此需要创建一个新的 Token,参见[文档](https://docs.github.com/en/github/authenticating-to-github/creating-a-personal-access-token)
98+
9599
- 配置 Token
96-
- 在项目或组织维度配置 `NPM_TOKEN` 这个 `secrets`
100+
- 在项目或组织维度配置 2 个 `secrets``NPM_TOKEN` `GIT_TOKEN`
97101
- 参见[文档](https://docs.github.com/en/codespaces/managing-codespaces-for-your-organization/managing-encrypted-secrets-for-your-repository-and-organization-for-github-codespaces)
98102

99103
- 创建 `.github/workflows/release.yml`

0 commit comments

Comments
 (0)