Skip to content

Add ready_for_review trigger to code review workflow#32

Merged
nickwinder merged 3 commits intomainfrom
nick/ncr/ready-for-review-trigger
Mar 3, 2026
Merged

Add ready_for_review trigger to code review workflow#32
nickwinder merged 3 commits intomainfrom
nick/ncr/ready-for-review-trigger

Conversation

@nickwinder
Copy link

@nickwinder nickwinder commented Mar 2, 2026

Why

The workflow was missing the `ready_for_review` trigger, meaning it would not fire when a draft PR was converted to ready for review.

In practice this appeared to work — but only by accident. With GitHub Copilot's automatic reviewer ruleset enabled, Copilot auto-assigns itself as a reviewer when a PR becomes ready. That auto-assignment fires a `review_requested` event, which was in the trigger list, causing the workflow to run indirectly.

This created a hidden dependency on Copilot being installed and configured. Without it (or if the ruleset changes), the workflow would silently stop triggering for draft PRs being promoted to ready.

`review_requested` is also removed for the same reason — it was only serving as the accidental workaround. Re-triggering via `@mention` is already handled by the `issue_comment` trigger.

References:

Summary

  • Add `ready_for_review` to `pull_request` event types in the workflow so the trigger fires directly when a draft PR is promoted
  • Remove `review_requested`, which was an accidental workaround via Copilot's auto-reviewer ruleset and is no longer needed
  • Map `ready_for_review` to the `open` trigger type in `action.yml` — it was missing from the `case` statement, causing the action to see trigger type `unknown` and skip the review entirely

@nickwinder nickwinder self-assigned this Mar 2, 2026
@nickwinder nickwinder marked this pull request as ready for review March 2, 2026 21:22
@nickwinder nickwinder marked this pull request as draft March 2, 2026 21:27
@nickwinder nickwinder marked this pull request as ready for review March 2, 2026 21:27
Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

📋 PR Summary:
This PR adds the ready_for_review trigger type to handle draft PRs being promoted to ready status, replacing the review_requested trigger which was only working accidentally due to GitHub Copilot's auto-reviewer ruleset. The change ensures the workflow fires directly when a draft PR becomes ready, without depending on external tooling.

2 files reviewed
File Changes
.github/workflows/code-review.yml Replace review_requested with ready_for_review trigger type
action.yml Map ready_for_review to 'open' trigger type in case statement

No issues found. Changes look good.

@nickwinder nickwinder merged commit d0af9a4 into main Mar 3, 2026
3 checks passed
@nickwinder nickwinder deleted the nick/ncr/ready-for-review-trigger branch March 3, 2026 02:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants