About automatic code review
By default, Copilot will only review a pull request when it is assigned to the pull request in the same way you would assign a human reviewer. However, repository owners can configure Copilot to automatically review all pull requests in the repository. Organization owners can configure Copilot to automatically review all pull requests in some or all of the repositories in the organization.
Triggering an automatic pull request review
After you configure automatic code review, Copilot will review pull requests in the following situations:
-
When a pull request is created as an "Open" pull request.
A review is not triggered if the pull request is created as a "Draft" pull request.
-
The first time a "Draft" pull request is switched to "Open".
Note
Copilot only automatically reviews a pull request once. If you make changes to the pull request after it has been automatically reviewed and you want Copilot to re-review the pull request, you must request this manually. To do this, click the button next to Copilot's name in the Reviewers menu.
Configuring automatic code review for a single repository
-
GitHub에서 리포지토리의 기본 페이지로 이동합니다.
-
리포지토리 이름 아래에서 설정을 클릭합니다. "설정" 탭이 표시되지 않으면 드롭다운 메뉴를 선택한 다음 설정을 클릭합니다.
-
왼쪽 사이드바의 "코드 및 자동화"에서 규칙을 클릭한 다음 규칙 세트를 클릭합니다.
-
Click New ruleset.
-
Click New branch ruleset.
-
Under "Ruleset name," type a name for the ruleset.
-
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.
Configuring automatic code review for repositories in an organization
-
GitHub의 오른쪽 위 모서리에서 프로필 사진을 선택하고 조직을 클릭합니다.
-
조직 옆에 있는 설정을 클릭합니다.
-
왼쪽 사이드바의 "코드, 계획, 자동화" 섹션에서 리포지토리를 선택한 다음 규칙 집합을 클릭합니다.
-
Click New ruleset.
-
Click New branch ruleset.
-
Under "Ruleset name," type a name for the ruleset.
-
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 infeature
.For information about pattern-matching syntax, see 조직에서 리포지토리에 대한 규칙 집합 만들기.
-
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 patternnot-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.