Repository navigation
Conversation
Track the next PR action with ordinary GitHub events instead of hosted AI triage and a shared personal token. Keep semantic review and merge acceptance with reviewers and maintainers. Use default-branch code for label writes, relay fork review notifications without privileged PR execution, and invalidate readiness when the head or required merge conditions change.
Default batch enrollment to PRs updated within 90 days, configurable via PR_WORKFLOW_IDLE_DAYS. Keep existing workflow states under observation and always process direct events and explicit PR requests.
Upgrade github-script to v8 to avoid the Node.js 20 deprecation warning seen in the demo workflow. Keep the runtime update separate from PR eligibility changes.
There was a problem hiding this comment.
🟡 Changes recommended
Unresolved critical issues can leave the ready-to-merge label in place despite outside or unauthorized feedback and can abort classification of non-collaborator reviews.
4 open issues
What changed in this PR
Adds an event-driven GitHub Actions workflow for tracking pull-request next actions through standardized status/* labels while keeping review interpretation and merge decisions with maintainers.
Changes:
- Documents six workflow states, handoff rules, and triage guidance.
- Adds trusted lifecycle, review-signal, readiness, and reconciliation workflows.
- Implements deterministic synchronization with regression tests.
| File | Description |
|---|---|
| CONTRIBUTING.md | Documents the six PR workflow labels and review handoff rules in English and Chinese. |
| .github/workflows/pr-workflow-checks.yml | Runs regression tests for the PR workflow implementation. |
| .github/workflows/pr-status-label.yml | Coordinates lifecycle, review, CI, scheduled, and manual synchronization using trusted default-branch code. |
| .github/workflows/pr-review-signal.yml | Relays pull-request review activity without privileged permissions or pull-request code execution. |
| .github/skills/pr-workflow/SKILL.md | Defines workflow states, review handoffs, and GitHub usage guidance. |
| .github/scripts/pr-status-label.test.cjs | Provides functional regression coverage for lifecycle, review, readiness, concurrency, batching, and security behavior. |
| .github/scripts/pr-status-label.cjs | Implements PR selection, label transitions, review handling, readiness tracking, and merge-condition checks. |
| .github/agents/pr-triage.agent.md | Adds a read-only interactive entry point for PR workflow triage. |
Review effort: Lite
| if (context.eventName === 'pull_request_target' && event.action === 'labeled' | ||
| && event.label?.name === READY && event.pull_request.head.sha === pr.head.sha) { | ||
| if (!unchanged(pr, await readPr())) return; | ||
| await recordTracker(pr.head.sha); |
There was a problem hiding this comment.
Fixed in df536cf. The label event sender must have write, maintain or admin permission before a readiness record is created; triage/read/none and missing senders hand off to awaiting-maintainer. Write is intentionally accepted because the workflow uses repository write access as its maintainer decision boundary, rather than requiring GitHub's specifically named Maintain role. The skill now states this boundary explicitly, with functional coverage for each role.
| } else if (state === READY) { | ||
| await checkReadiness(); |
There was a problem hiding this comment.
Fixed in a94bad6. A validated current-head COMMENTED review now moves an already-ready PR to awaiting-maintainer and removes its readiness record. It requires interpretation rather than preserving readiness solely because required checks still pass. Optional APPROVED reviews continue to preserve readiness.
| } else if (state === READY) { | ||
| await checkReadiness(); |
There was a problem hiding this comment.
Fixed in a94bad6. A validated current-head outside CHANGES_REQUESTED review now revokes readiness and hands off to awaiting-maintainer. Trusted unanswered changes requests still route directly to awaiting-author. Regression coverage verifies both outside feedback paths and readiness-record cleanup.
| const { data } = await github.rest.repos.getCollaboratorPermissionLevel({ | ||
| owner, repo, username: review.user.login, | ||
| }); | ||
| if (['write', 'maintain', 'admin'].includes(data.permission)) requests.push(review); |
There was a problem hiding this comment.
Handled in df536cf: 404 is treated as no decision permission, while 403 and other API failures still propagate without changing labels. The premise is not universal: a read-only query for the Copilot reviewer in this repository returned 200 with permission: none. Both normal untrusted responses and the 404 fallback are supported; tests also verify that unrelated API errors are not swallowed.
Require write, maintain or admin permission before recording the head accepted as ready to merge. A triage-only labeler must hand the decision to a maintainer. Treat missing collaborators as untrusted and propagate other permission lookup failures.
Return a ready PR to maintainer evaluation after a new COMMENT review or outside changes request. Preserve readiness after optional positive reviews; trusted unanswered changes requests still route to the author.


What problem does this PR solve?
Issue Number: N/A
Problem Summary:
Open PRs need a filterable indication of their next action so authors,
reviewers, AI agents and maintainers can hand work back and forth without
losing track of pending reviews or decisions.
Implements the workflow discussed in
#3719 using ordinary GitHub Actions,
without a hosted AI triage service, shared personal AI token or per-PR command.
What is changed and the side effects?
Changed:
them in CONTRIBUTING.md. Add an interactive agent entry point for the skill.
using deterministic API checks. Maintainers retain semantic review decisions
and final merge readiness; the workflow never approves or merges a PR.
default-branch code and do not execute PR code or consume workflow artifacts.
head change or an unmet required merge condition.
after 90 days without updates, configurable through PR_WORKFLOW_IDLE_DAYS.
Existing workflow states, direct events and explicit PR requests bypass this
age filter.
Side effects:
to manage labels and readiness bookkeeping comments. Semantic interpretation,
AI review scheduling and abandoned-review detection remain manual.
reconciliation batch; no impact on the brpc runtime.
Check List: