ci(review): auto-clear the review gate after approvals on fork PRs#3853
Merged
Conversation
The review-signal clear job runs on pull_request_review, but for fork PRs that event's token is read-only — it 403s removing labels / setting the check, so a fork approval never cleared the gate (e.g. #3852 stayed blocked after a code-owner approved). New review-clear workflow runs on workflow_run after Review signal completes for a review submission. From the base repo (write token, works for forks) it resolves the PR from the run head SHA and re-dispatches the review-signal flag logic, which reads the approval and clears the gate fork-safely. No loop: the dispatch run has event=workflow_dispatch, which this job's if-condition excludes.
|
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 |
…ew-clear The old clear job ran on pull_request_review and could not write on fork PRs (read-only token → 403), so it never cleared fork approvals. review-clear.yml now handles clearing for all PRs via workflow_run + fork-safe flag re-dispatch. Remove the redundant clear job. Add a tiny review-anchor job that runs on approval so the Review signal workflow reliably completes (not skipped), guaranteeing review-clear's workflow_run fires.
cixzhang
enabled auto-merge (squash)
July 12, 2026 02:11
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.
Problem (from #3852)
A code owner approved #3852 (a fork PR), but the gate never cleared. The old
clearjob runs onpull_request_review, and for fork PRs that event's token is read-only — it 403s removing labels / setting the check:Fix — one unified, fork-safe clearing path
review-clear.yml: runs onworkflow_runafter Review signal completes for a review. From the base repo (write-capable token, works for forks), it resolves the PR from the run's head SHA and re-dispatches thereview-signalflag logic, which reads the approval and clears the gate fork-safely.clearjob — it was fork-broken (403 on forks) and now redundant.review-clearhandles all PRs, fork and same-repo alike (one path, no drift).review-anchorjob that runs onpull_request_review, so the Review signal workflow reliably completes (rather than ending up "skipped" with no jobs) — which is what firesreview-clear'sworkflow_run.No loop: the re-dispatch runs as
workflow_dispatch, whichreview-clear'sifexcludes.Net: an owner's approval on any PR — fork or same-repo — auto-clears the gate. Minor tradeoff: clearing now takes an extra workflow hop (a few seconds), which is fine for a non-time-critical gate.