Skip to content

fix(ci): resolve PR by head_branch in review-clear (approvals now auto-clear) - #3861

Merged
cixzhang merged 1 commit into
mainfrom
navi/ci/fix-clear-pr-resolution
Jul 12, 2026
Merged

cixzhang merged 1 commit into
mainfrom
navi/ci/fix-clear-pr-resolution

Conversation

@cixzhang

Copy link
Copy Markdown
Contributor

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 logged No PR resolved for this review run and did nothing.

Root cause: it resolved the PR from workflow_run.head_sha. But for a workflow_run fired by a pull_request_review-triggered workflow, that top-level head_sha (and head_branch) point at main, not the PR — and pull_requests is 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 is 7948bbd on branch ci/parallel-deploy-build.

Fix

The triggering run's own head_branch is correct even for forks (ci/parallel-deploy-build). Resolve the open PR by matching that branch (head=OWNER:branch, with a scan-by-head.ref fallback) instead of the useless head_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.

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
cixzhang requested a review from imdreamrunner as a code owner July 12, 2026 05:00
@cixzhang
cixzhang enabled auto-merge (squash) July 12, 2026 05:00
@vercel

vercel Bot commented Jul 12, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
astryx Ready Ready Preview, Comment Jul 12, 2026 5:02am

Request Review

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Jul 12, 2026

@thedjpetersen thedjpetersen left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved.

@cixzhang
cixzhang merged commit 6f1d7d5 into main Jul 12, 2026
20 checks passed
github-actions Bot added a commit that referenced this pull request Jul 12, 2026
@github-actions

Copy link
Copy Markdown
Contributor

PR Analysis Report

📚 Storybook Preview

View Storybook for this PR
GitHub Pages may take up to a minute to hydrate after deploy.

🧪 Sandbox Preview

View Sandbox for this PR
GitHub Pages may take up to a minute to hydrate after deploy.

No new or modified components detected.

Bundle Size Summary

Package Size (ESM) Size (CJS) Gzipped
@astryxdesign/core N/A 4.6KB 0B

Accessibility Audit

Status: No accessibility violations detected.


Generated by PR Enrichment workflow | Storybook | Sandbox | View full report

@github-actions
github-actions Bot deleted the navi/ci/fix-clear-pr-resolution branch July 12, 2026 06:58

This branch was successfully deployed

1 active deployment
Preview — e9e86213 Deployed Jul 12, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Meta Open Source bot.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants