Skip to main content

Reviewing a pull request created by Copilot

After Copilot creates a pull request you should review it and comment on anything that needs changes.

谁可以使用此功能?

Copilot 编码智能体 可供 GitHub Copilot Pro+ 用户和 GitHub Copilot Enterprise 客户使用。 我们还开始向 GitHub Copilot Business 客户推出,一旦此功能可供你使用,你将收到一封电子邮件。
Sign up for Copilot

注意

Copilot 编码智能体 为 公共预览版,可能会变动。 在预览期间,该功能的使用须遵循“GitHub 预发行许可条款”。

Reviewing Copilot's changes

After Copilot has finished working on a coding task, and has requested a pull request review from you, you should review Copilot's work thoroughly before merging the pull request.

重要

If you have the "Required approvals" rule or branch protection enabled, you won't be able to approve pull requests that you initiated by assigning the related issue to Copilot. Someone else must approve the pull request before it can be merged.

You can ask Copilot to make changes using pull request comments, or you can check out Copilot's branch and make changes yourself.

提示

We recommend you batch your review comments instead of submitting them individually.

When you leave a comment on Copilot's pull request, Copilot will consider your comment, and decide whether to start a new agent session to respond.

Copilot only responds to comments from people who have write access to the repository.

If Copilot starts a new agent session in response to your comment, an eyes emoji (👀) is added as a reaction to the comment, and a "Copilot has started work" event is added to the pull request timeline.

Screenshot of a pull request timeline with a review comment with the eyes reaction and a "Copilot started work" timeline event.

Copilot may ignore a comment if it considers that the comment was not intended for it. If you are sure that you want Copilot to respond to your comment, you can @mention Copilot by including @copilot in your comment.

提示

If you don't want Copilot to respond to comments on a pull request, you can unassign Copilot from the pull request. If you later reassign Copilot to the same pull request it will respond to new comments and push more changes. It will not respond to comment that were added while it was not assigned.

For more information, see the section "Use comments to iterate on a pull request" in Best practices for using Copilot to work on tasks.

Managing GitHub Actions workflow runs

GitHub Actions workflows will not run automatically when Copilot pushes changes to a pull request.

GitHub Actions workflows can be privileged and have access to sensitive secrets. 检查拉取请求中的拟议更改,确保您在拉取请求分支上自由运行您的工作流程。 应特别注意 .github/workflows/ 目录中影响工作流文件的任何拟议更改。

To allow GitHub Actions workflows to run, click the Approve and run workflows button in the pull request's merge box.

Screenshot of the merge box on a pull request from Copilot with the "Approve and run workflows" button.

Giving feedback on Copilot's work

You can provide feedback on Copilot's work using the feedback buttons on Copilot's pull requests and comments. We use your feedback to improve the product and the quality of Copilot's solutions.

  1. On a pull request or comment from Copilot, click the thumbs up (👍) or thumbs down (👎) button.
  2. If you click the thumbs down button, you're asked to provide additional information. You can, optionally, pick the reason for your negative feedback and leave a comment before clicking Submit feedback.

Further reading