Skip to content

Add workflow that limits Copilot reviews to 3 per PR - #8

Closed
baelter wants to merge 3 commits into
mainfrom
copilot-review-cap
Closed

baelter wants to merge 3 commits into
mainfrom
copilot-review-cap

Conversation

@baelter

@baelter baelter commented Nov 11, 2026

Copy link
Copy Markdown
Member

Background

Copilot code review uses AI units, and the organization uses more than the plan includes. The org ruleset "Automatic Copilot code review" requests a new review on each push. One pull request got 9 reviews in 2 days. Many reviews after the third find few new problems.

Summary

This change adds the workflow copilot-review-cap.yml. An org ruleset will run it on all repositories as a required workflow.

  • The ruleset still requests 1 Copilot review when a pull request opens.
  • On each push, the workflow counts the Copilot reviews on the pull request. If the count is less than 3, it requests a new Copilot review.
  • At 3 reviews, the workflow posts 1 comment. The comment tells the author to test the change locally and review the diff with Claude Code or a teammate.
  • The workflow does nothing for draft pull requests.
  • A person can still request a Copilot review manually.

Rollout

  1. Test the workflow on this pull request.
  2. Set review_on_push to false in the org ruleset.
  3. Add this workflow as a required workflow in an org ruleset.

The org ruleset requests a Copilot review on each push, and the reviews use AI units. This workflow requests a new review on each push until the PR has 3 Copilot reviews. Then it posts 1 comment that tells the author to test the change locally.
@baelter
baelter marked this pull request as ready for review November 11, 2026 08:57

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 Changes recommended

The workflow has active correctness issues that can block fork pull requests and fail to request or announce review-cap behavior on key events.

3 open issues
What changed in this PR

This pull request adds a GitHub Actions workflow that limits automatic Copilot code-review requests to three per pull request and posts guidance when the cap is reached.

Changes:

  • Handles pull request events with concurrency control and draft-pull-request checks.
  • Counts reviews from the Copilot reviewer bot and requests additional reviews below the limit.
  • Posts a marker-based notification after the review cap is reached.
File Description
.github/​workflows/​copilot-review-cap.yml Defines the workflow for counting Copilot reviews, requesting reviews below the cap, and posting a cap notification.

Review effort: Lite

Comment on lines +5 to +7
on:
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
- name: Request a Copilot review or ask the author to work locally
run: |
set -euo pipefail
if [[ "$ACTION" != "synchronize" || "$DRAFT" == "true" ]]; then

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🔵 Needs a closer look

The workflow can miss posting the promised cap comment when the third Copilot review arrives after the synchronize run exits, unless another push occurs.

2 open issues
1 resolved since last review

Review effort: Lite

@baelter baelter closed this Nov 11, 2026
@baelter
baelter deleted the copilot-review-cap branch November 11, 2026 12:34
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