Automate removal of the ready-for-review label#1568
Conversation
Adds a caller workflow that invokes the org-wide reusable manage-ready-for-review workflow to strip the ready-for-review label when a PR is closed or merged, becomes a draft, gains >=2 approvals, or gains >=2 change requests. Documents the label lifecycle in docs/github-labels.md. Signed-off-by: Simon Davies <simongdavies@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
This PR introduces an automated mechanism to remove the ready-for-review label when a pull request is no longer awaiting review, by wiring repository events into a reusable org-wide workflow. It also documents the intended manual-add / automatic-remove behavior in the project’s label documentation.
Changes:
- Adds a new GitHub Actions workflow that calls the shared
hyperlight-dev/.github“manage-ready-for-review” reusable workflow on relevant PR/review events. - Documents the “ready-for-review” label lifecycle (when to add it, and when it will be removed automatically).
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
.github/workflows/ready-for-review-label.yml |
Adds the caller workflow that triggers on PR closure/draft conversion and review submission/dismissal, and invokes the pinned org-wide reusable workflow. |
docs/github-labels.md |
Documents the ready-for-review label purpose and the automatic removal criteria. |
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> Signed-off-by: Simon Davies <simongdavies@users.noreply.github.com>
Signed-off-by: Simon Davies <simongdavies@users.noreply.github.com>
| manage-label: | ||
| # Shared engine in the org-wide `.github` repository, pinned to a commit SHA | ||
| # (matching this repository's action-pinning convention). | ||
| uses: hyperlight-dev/.github/.github/workflows/manage-ready-for-review.yml@8eaae4229db908ea64fff06c31dbf5677611ce5e |
There was a problem hiding this comment.
TIL too :) https://docs.github.com/en/actions/how-tos/reuse-automations/share-with-your-organization
nit: the comment above sounds very AI-generated
| # "ready-for-review" label once a PR is no longer awaiting review. | ||
| # | ||
| # `pull_request_target` (rather than `pull_request`) is required so that the job | ||
| # has a read/write token for pull requests opened from forks. This is safe here |
There was a problem hiding this comment.
Did we try this with pull_request first? its only a write for issues and I don't think pull_request_target is needed for that:
hyperlight/.github/workflows/RustNightly.yml
Lines 133 to 134 in 69c362b
pull_request also has types of closed/converted_to_draft https://docs.github.com/en/actions/reference/workflows-and-actions/events-that-trigger-workflows#pull_request
There was a problem hiding this comment.
agree pull_request_target is a code smell. Although it might be better soon https://github.blog/changelog/2026-06-18-safer-pull_request_target-defaults-for-github-actions-checkout/
What
Automates removal of the
ready-for-reviewlabel from a pull request once it isno longer awaiting review.
The label is used to automate requests for review.
The label is removed when any of the following become true:
Adding the label stays a manual / author action (now documented in
docs/github-labels.md); only removal is automated.How
The reusable workflow lives in the organisation's
.githubrepository(
hyperlight-dev/.github) so every repository in the org can share one implementation.pull_request_targetis used so the job has a write-scoped token for pullrequests from forks. This is safe because the engine never checks out or
executes PR code — it only reads PR metadata and removes a label.