Learn how to configure Copilot to automatically review pull requests.
IntroductionThis article tells you how to set up Copilot code review to review pull requests automatically. For an overview of automatic pull request reviews, see About GitHub Copilot code review.
The three sections in this article tell you how to configure automatic code review for:
Note
This is only available if you are on the Copilot Pro or Copilot Pro+ plan.
In the upper-right corner of any page, click your profile picture, then click Your Copilot.
Locate the Automatic Copilot code review option and click the dropdown button.
In the dropdown menu, select Enabled.
On GitHub, navigate to the main page of the repository.
Under your repository name, click Settings. If you cannot see the "Settings" tab, select the dropdown menu, then click Settings.
In the left sidebar, under "Code and automation," click Rules, then click Rulesets.
Click New ruleset.
Click New branch ruleset.
Under "Ruleset name," type a name for the ruleset.
To activate the ruleset, under "Enforcement Status", select Active.
Under "Target branches," click Add target and choose one of the options—for example, Include default branch or Include all branches.
Under "Branch rules," select the Require a pull request before merging checkbox.
This expands a set of subsidiary options.
Select the Request pull request review from Copilot checkbox.
At the bottom of the page, click Create.
In the upper-right corner of GitHub, click your profile picture, then click Your organizations.
Next to the organization, click Settings.
In the left sidebar, in the "Code, planning, and automation" section, click Repository, then click Rulesets.
Click New ruleset.
Click New branch ruleset.
Under "Ruleset name," type a name for the ruleset.
To activate the ruleset, under "Enforcement Status", select Active.
Under "Target repositories," click Add target and choose either Include by pattern or Exclude by pattern.
In the dialog box that's displayed, type a pattern that will match the names of repositories in your organization—for example, *feature
to match all repositories with names that end in feature
.
For information about pattern-matching syntax, see Creating rulesets for repositories in your organization.
In the dialog box, click Add inclusion pattern or Add exclusion pattern.
Repeat the process for any additional patterns you want to add.
Note
You can add multiple targeting criteria to the same ruleset. Exclusion patterns are applied after inclusion patterns. For example, you could include any repositories matching the pattern *cat*
, and specifically exclude a repository matching the pattern not-a-cat
.
Under "Target branches," click Add target and choose one of the target options.
Under "Branch rules," select the Require a pull request before merging checkbox.
This expands a set of subsidiary options.
Select the Request pull request review from Copilot checkbox.
At the bottom of the page, click Create.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4