fix(ci): changeset Version PR 权限 + tools@0.2.0-beta.1 - #75
Closed
cursor[bot] wants to merge 2 commits into
Closed
Conversation
changeset-release 在 version bump 后因仓库禁止 GITHUB_TOKEN 开 PR 失败。 改用 CHANGESETS_GITHUB_TOKEN(可选)并文档化 Actions 勾选要求; 同时落地 Version 内容(tools beta.1),并修正 listPendingChangesetFiles 在 pre mode 下误把已消费 .md 当待消费(LSP)。 Co-authored-by: Shiroha <Tanya7z@users.noreply.github.com>
MAJOR/LSP:fetch-depth:0 后 CI 仍默认 --from-existing 会收录全部已有 name@version;空 RELEASE_TAGS_STATE 被 push/gh-release 当缺失并全量扫描。 改为默认 HEAD~1 diff;releaseTagsStateKind 区分 missing/empty/present。 Co-authored-by: Shiroha <Tanya7z@users.noreply.github.com>
Contributor
Author
There was a problem hiding this comment.
审查结论(相对 #76)
本 PR(#75)与并行补丁 #76 覆盖同一 push(main@2d7f763 / changeset-release 开 Version PR 失败)。
已对齐 / 建议合入路径
请优先合并 #76(已吸收本 PR 独有点):
CHANGESETS_GITHUB_TOKEN || GITHUB_TOKEN+ Version PR 权限文档listPendingChangesetFiles排除pre.json#changesets(MAJOR · LSP)- tools
@0.2.0-beta.1Version 内容
#76 额外包含:
resolveReleaseTagEntries:空.sfmc-release-tags.json一律信任(MAJOR · LSP / DRY)tag-packages取消 CI 强制--from-existing(MAJOR · LSP)remote-controllerproject-root.ts(MINOR · DIP)
本 PR 可关闭
合入 #76 后本 PR 可关闭,避免双头 version bump。
维护者仍需:勾选 Actions「create and approve pull requests」或配置 CHANGESETS_GITHUB_TOKEN。
Sent by Cursor Automation: SFMC-Review
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.


Summary
changeset-release@d37f166/2d7f763(合入 #74 / #73)失败:version bump 与changeset-release/main推送成功,但创建 Version PR 时报:HttpError: GitHub Actions is not permitted to create or approve pull requestsBLOCKER — 发版门禁(非代码逻辑,属 CI 契约)
仓库/组织关闭了 Actions「Allow GitHub Actions to create and approve pull requests」时,仅声明
pull-requests: write+secrets.GITHUB_TOKEN仍无法开 PR。此前成功 run 走的是 publish 路径(无待开 Version PR),故未暴露。修复:
GITHUB_TOKEN: ${{ secrets.CHANGESETS_GITHUB_TOKEN || secrets.GITHUB_TOKEN }}docs/dev/npm-publish.md:写明勾选 Actions 选项 或 配置 PAT Secret@sfmc-bds/tools→0.2.0-beta.1+pre.json(合入后应走 publish,不再卡在开 PR)MAJOR — LSP(
listPendingChangesetFiles)pre mode 下已消费的
.md会留在磁盘直到pre exit;原实现把它们算作「待消费」,与@changesets的getRelevantChangesets契约不一致,会导致changeset-ensure误跳过交互添加。修复: 排除
pre.json#changesets中已记录的 id;单测覆盖。审查笔记(#73/#74 残留,本 PR 未改)
project-root.ts(均已 DIP 到resolveRuntimeRoot;跨包再抽共享收益小)pre.json#changesets在下次changeset version时会被重写为「磁盘上仍存在的 .md id」——#74 手工恢复的历史 id 列表被冲掉是 changesets 预期行为,不影响 publishTest plan
node --test tools/changeset-release.test.mjslistPendingChangesetFiles()→[](当前 pre 态)CHANGESETS_GITHUB_TOKENchangeset-release应 publish@sfmc-bds/tools@0.2.0-beta.1(而非再开 Version PR 失败)