Repository navigation
fix(ci): resolve PR by head_branch in review-clear (approvals now auto-clear) - #3861
Merged
Merged
Conversation
review-clear never actually cleared: it resolved the PR from workflow_run.head_sha, but for a workflow_run fired by a pull_request_review-triggered workflow that SHA (and the payload branch) point at main, not the PR — and pull_requests is empty for forks. So it always logged 'No PR resolved' and did nothing (e.g. #3812 stayed pending after approval). The triggering run's own head_branch IS correct even for forks (e.g. ci/parallel-deploy-build). Resolve the open PR by matching that branch (head=OWNER:branch, with a scan-by-ref fallback) instead of the useless head_sha.
cixzhang
enabled auto-merge (squash)
July 12, 2026 05:00
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
josephfarina
approved these changes
Jul 12, 2026
Contributor
PR Analysis Report📚 Storybook PreviewView Storybook for this PR 🧪 Sandbox PreviewView Sandbox for this PR No new or modified components detected. Bundle Size Summary
Accessibility AuditStatus: No accessibility violations detected. Generated by PR Enrichment workflow | Storybook | Sandbox | View full report |
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.
Bug (why approvals still didn't auto-clear, e.g. #3812)
review-clear(from #3860) clears directly — but it never resolved the PR, so it always loggedNo PR resolved for this review runand did nothing.Root cause: it resolved the PR from
workflow_run.head_sha. But for aworkflow_runfired by apull_request_review-triggered workflow, that top-levelhead_sha(andhead_branch) point at main, not the PR — andpull_requestsis empty for forks. So the SHA lookup found a main commit with no PR.Confirmed on #3812: the clear run's payload had
head_sha=04e7f1c2 branch=main, while the PR head is7948bbdon branchci/parallel-deploy-build.Fix
The triggering run's own
head_branchis correct even for forks (ci/parallel-deploy-build). Resolve the open PR by matching that branch (head=OWNER:branch, with a scan-by-head.reffallback) instead of the uselesshead_sha. Verified:gh pr list --head ci/parallel-deploy-build→ #3812.After this, an entitled owner's approval auto-clears the gate (drop label + status success + neutralize stale check-run) with no manual dispatch.