Skip to content

ci(review): auto-clear the review gate after approvals on fork PRs#3853

Merged
cixzhang merged 2 commits into
mainfrom
navi/ci/fork-approval-autoclear
Jul 12, 2026
Merged

ci(review): auto-clear the review gate after approvals on fork PRs#3853
cixzhang merged 2 commits into
mainfrom
navi/ci/fork-approval-autoclear

Conversation

@cixzhang

@cixzhang cixzhang commented Jul 12, 2026

Copy link
Copy Markdown
Contributor

Problem (from #3852)

A code owner approved #3852 (a fork PR), but the gate never cleared. The old clear job runs on pull_request_review, and for fork PRs that event's token is read-only — it 403s removing labels / setting the check:

DELETE .../labels/needs:code-review → 403: Resource not accessible by integration

Fix — one unified, fork-safe clearing path

  • New review-clear.yml: runs on workflow_run after 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 the review-signal flag logic, which reads the approval and clears the gate fork-safely.
  • Removed the old clear job — it was fork-broken (403 on forks) and now redundant. review-clear handles all PRs, fork and same-repo alike (one path, no drift).
  • Added a tiny review-anchor job that runs on pull_request_review, so the Review signal workflow reliably completes (rather than ending up "skipped" with no jobs) — which is what fires review-clear's workflow_run.

No loop: the re-dispatch runs as workflow_dispatch, which review-clear's if excludes.

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.

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.
@cixzhang
cixzhang requested a review from imdreamrunner as a code owner July 12, 2026 01:58
@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 2:11am

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.

github-actions Bot added a commit that referenced this pull request Jul 12, 2026
@github-actions

github-actions Bot commented Jul 12, 2026

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

…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
cixzhang enabled auto-merge (squash) July 12, 2026 02:11
@cixzhang
cixzhang merged commit 24216df into main Jul 12, 2026
17 checks passed
github-actions Bot added a commit that referenced this pull request Jul 12, 2026
@github-actions
github-actions Bot deleted the navi/ci/fork-approval-autoclear branch July 12, 2026 06:58
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