Repository navigation
fix(ci): 修复预览发布的 PR 识别 - #1215
Merged
Merged
Conversation
Contributor
Web DemoAPK 下载 |
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.

🤔 这个 PR 的性质是?
🔗 相关 Issue
无关联 Issue。
💡 需求背景和解决方案
预览发布此前在目标仓库按提交查询关联 PR;fork PR 的提交关联查询可能返回空列表,即使 PR 存在,导致预览未发布且失败评论使用无效编号。
保留现有成功和失败 job,改为按来源 owner 和分支在目标仓库分页查询开放 PR,并校验目标仓库、目标分支、来源仓库、来源分支及 head SHA;只有唯一匹配才继续。PR 识别失败时不再尝试写失败评论。构建元数据中 PR 编号的交叉校验保持不变。
本地验证:使用临时脚本解析工作流并模拟 GitHub API,覆盖 fork、同仓库、来源和目标不匹配、旧 SHA、无匹配、多匹配以及两条路径一致性,结果通过;
actionlint和git diff --check通过。测试脚本和 CI job 不包含在本 PR 中,模拟验证不代表完整部署验证。此 PR 不新增部署或评论前的二次复查;PR head 在识别后改变时,仍存在旧运行发布或更新评论的竞态。PR 自身的 workflow_run 发布通常使用默认分支配置,不能以该 PR 的预览结果证明新发布逻辑;合并后仍需用真实 fork PR 验证完整预览发布。
📝 更新日志
无,属于 CI 工作流修复。
本条 PR 不需要纳入 Changelog
☑️ 请求合并前的自查清单
type(<scope>?): 修改描述。示例:
fix(TBottomTabBar): 修复 iconText 模式底部溢出本次为局部 CI 修复,无公开组件契约变更,无需新增 Spec;无须修改组件文档。