fix(ci): fork PR 的定位方式修正(评论与自动合并原本被静默跳过) - #102
Merged
Merged
Conversation
Syncs from CardputerZero/dev-portal (50bd9c4). listPullRequestsAssociatedWithCommit only sees commits in the repository it is asked about, so for a fork PR it returned nothing and the privileged stage silently skipped both the comment and the merge (seen on #101). Listing open PRs filtered by head does find them, and the head SHA from the event is still checked, so the decision rests on the same trusted inputs. Co-authored-by: Cursor <cursoragent@cursor.com>
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.
在 #101 的自检里发现:
listPullRequestsAssociatedWithCommit只能看到本仓库的 commit,fork PR 的 head commit 查不到,于是特权阶段既没发评论也没执行合并,而 job 仍是 success(静默跳过)。改成按 head 仓库+分支列 open PR 来定位,并保留对事件 head SHA 的比对,判断依据仍然全部来自可信来源(事件 + API),不碰 artifact。
Made with Cursor