Skip to content

ci(release): create release PRs with a GitHub App token - #70

Merged
xiaoland merged 3 commits into
mainfrom
chore/release-app-token
Oct 23, 2026
Merged

xiaoland merged 3 commits into
mainfrom
chore/release-app-token

Conversation

@xiaoland

Copy link
Copy Markdown
Member

问题

changesets/action 用默认 GITHUB_TOKEN 开出的 version-packages PR 永远不会触发 CI(GitHub 抑制 GITHUB_TOKEN 产生的事件),导致发布 PR 无法满足分支规则集的 ui-web checks 要求——每次发版都得人工推一个空提交点燃检查(2.4.0 和 2.5.0 已经各踩过一次)。

方案

按 create-pull-request 文档的建议,改用 GitHub App 安装令牌(比 PAT 更优:按仓库安装、权限声明式、令牌短命自动刷新、不绑定个人账号):

  • 新建 org 级 App inkcre-release(contents/write + pull_requests/write,无 webhook)
  • 工作流用 actions/create-github-app-token(pin v2.2.1 SHA)现场铸令牌,经 github-token 输入传给 changesets/action——PR 以 App 身份开出,CI 正常触发
  • npm 发布(NODE_AUTH_TOKEN)仍用 GITHUB_TOKEN,不变

Secrets(INKCRE_RELEASE_APP_ID / INKCRE_RELEASE_APP_PRIVATE_KEY)已配置到本仓库。

验证

  • App 安装令牌已在本地铸造成功(JWT → installation token)
  • 合并后下一次 changeset 进入 main 时,release PR 应自动带 ui-web checks 运行,无需再推空提交

github-actions Bot and others added 3 commits October 23, 2026 06:44
PRs opened by changesets/action with the default GITHUB_TOKEN never
trigger CI (GitHub suppresses events produced by GITHUB_TOKEN), so the
version-packages PR could not satisfy the 'ui-web checks' ruleset and
needed a manual empty commit before every merge.

Mint an installation token for the inkcre-release GitHub App (secrets
INKCRE_RELEASE_APP_ID / INKCRE_RELEASE_APP_PRIVATE_KEY) and pass it to
changesets/action's github-token input, so release PRs open as the app
and run CI like any other PR. Publishing still uses GITHUB_TOKEN for
npm.pkg.github.com auth.
@xiaoland
xiaoland merged commit 34c330d into main Oct 23, 2026
1 check passed
@xiaoland
xiaoland deleted the chore/release-app-token branch October 23, 2026 12:59

This branch was successfully deployed

1 active deployment
preview — 27ad657c Deployed Oct 23, 2026 by xiaoland via ui-web preview cleanup #34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant