Repository navigation
ci(release): create release PRs with a GitHub App token - #70
Merged
Merged
Conversation
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.
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
问题
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 更优:按仓库安装、权限声明式、令牌短命自动刷新、不绑定个人账号):
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 正常触发NODE_AUTH_TOKEN)仍用GITHUB_TOKEN,不变Secrets(
INKCRE_RELEASE_APP_ID/INKCRE_RELEASE_APP_PRIVATE_KEY)已配置到本仓库。验证
ui-web checks运行,无需再推空提交