feat: Add support for Copilot code review in repository rulesets #2965
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This change adds support for GitHub's Copilot code review feature in repository rulesets, allowing automatic code review requests for pull requests.
Changes:
The copilot_code_review rule supports two configuration options:
Both options default to false, matching GitHub UI behavior.
Resolves #2694 and #2583
Before the change?
The github_repository_ruleset resource did not support GitHub's Copilot code review feature
Users could not configure automatic Copilot code review requests through Terraform
Rulesets created in the GitHub UI with Copilot code review enabled would cause drift or errors when managed by Terraform
After the change?
Added support for the copilot_code_review rule in repository rulesets
Users can now configure automatic Copilot code review for pull requests with two options:
review_new_pushes - Copilot automatically reviews each new push to the pull request (defaults to false)
review_draft_pull_requests - Copilot automatically reviews draft pull requests before they are marked as ready for review (defaults to false)
The implementation follows the existing pattern for other ruleset rules and is fully backwards compatible
Empty copilot_code_review {} block enables the feature with default settings (both options disabled), matching GitHub UI behavior
Pull request checklist
Does this introduce a breaking change?
Please see our docs on breaking changes to help!
this feature is based on https://github.blog/changelog/2025-09-10-copilot-code-review-independent-repository-rule-for-automatic-reviews/ (an independent repository rule instead of pull request rule)