Skip to content

Commit f16db96

Browse files
authored
Merge pull request #3 from Aparencia/dev
fix(ci): 发版工作流改用 RELEASE_TOKEN 以绕过 main 分支保护
2 parents 05cdd0b + 75c6fe9 commit f16db96

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

‎.github/workflows/version-release.yml‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,10 @@ jobs:
3131
with:
3232
fetch-depth: 0
3333
persist-credentials: true
34+
# RELEASE_TOKEN:细粒度 PAT(Contents:RW),持有者为仓库 admin,
35+
# 配合 ruleset Bypass list(Repository admin)绕过 main 的 PR 强制规则;
36+
# 未配置该 secret 时回退内置 token(checkout 可用,push 仍会被规则拦截)
37+
token: ${{ secrets.RELEASE_TOKEN || github.token }}
3438

3539
- name: Setup Node
3640
uses: actions/setup-node@v4
@@ -42,5 +46,6 @@ jobs:
4246

4347
- name: Semantic Release
4448
env:
45-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
49+
# 同上:semantic-release 的 git push 与 GitHub Release 创建均使用 PAT
50+
GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN || secrets.GITHUB_TOKEN }}
4651
run: npx semantic-release

0 commit comments

Comments
 (0)