About reviewing pull requests
You can review changes in a pull request one file at a time. While reviewing the files in a pull request, you can leave individual comments on specific changes. After you finish reviewing each file, you can mark the file as viewed. This collapses the file, helping you identify the files you still need to review. A progress bar in the pull request header shows the number of files you've viewed. After reviewing as many files as you want, you can approve the pull request or request additional changes by submitting your review with a summary comment.
提示:可使用搜索限定符 review-requested:[USERNAME]
或 team-review-requested:[TEAMNAME]
查找请求� 或� 所属团队审查的拉取请求。 有关详细信息,请参阅“搜索问题和拉取请求”。
Starting a review
-
在存储库名称下,单击 “拉取请求”。
-
在拉取请求列表中,单击要审查的拉取请求。
-
On the pull request, click Files changed.
-
Optionally, filter the files to show only the files you want to review. For more information, see "Filtering files in a pull request."
-
将� � �悬停在要添� 评论的代� �行上方,然后单击蓝色的评论图� �。 若要在多行上添� 评论,请单击并拖动以选择行范围,然后单击蓝色的评论图� �。
-
在评论字段中输入您的评论。
-
Optionally, to suggest a specific change to the line or lines, click , then edit the text within the suggestion block.
-
When you're done, click Start a review. If you have already started a review, you can click Add review comment.
Before you submit your review, your line comments are pending and only visible to you. You can edit pending comments anytime before you submit your review. To cancel a pending review, including all of its pending comments, scroll down to the end of the timeline on the Conversation tab, then click Cancel review.
Reviewing dependency changes
注意:依赖项评审目前以 beta 版本提供,并且可能会发生更改。
If the pull request contains changes to dependencies you can use the dependency review for a manifest or lock file to see what has changed and check whether the changes introduce security vulnerabilities. For more information, see "Reviewing dependency changes in a pull request."
-
On the pull request, click Files changed.
-
On the right of the header for a manifest or lock file, display the dependency review by clicking the rich diff button.
-
您可能还想查看源差异,� 为清单或锁定文件可能会发生变化,但不会更改依赖项,也可能存在 GitHub � 法解析的依赖项,� 此,这些依赖项不会显示在依赖项审� �中。
要返回到源差异视图,请单击 按钮。
Marking a file as viewed
After you finish reviewing a file, you can mark the file as viewed, and the file will collapse. If the file changes after you view the file, it will be unmarked as viewed.
-
On the pull request, click Files changed.
-
On the right of the header of the file you've finished reviewing, select Viewed.
Submitting your review
After you've finished reviewing all the files you want in the pull request, submit your review.
-
On the pull request, click Files changed.
-
在更改的代� �上方,单击“审阅更改”。
-
输入评论,概述您对拟议更改的反馈。
-
Select the type of review you'd like to leave:
- Select Comment to leave general feedback without explicitly approving the changes or requesting additional changes.
- Select Approve to submit your feedback and approve merging the changes proposed in the pull request.
- Select Request changes to submit feedback that must be addressed before the pull request can be merged.
-
单击“提交审查”。
提示:
- 如果启用了必需的审查,并且对存储库具有写入、管理员或所有者访问权限的协作者提交请求更改的审查,则在同一协作者提交另一次要求批准拉取请求中更改的审查之前,拉取请求不能合并 。
- 即使没有获得批准审查,或者请求更改的审查者离开了组织或者联系不上,仓库所有者和管理员也可合并拉取请求。
- 如果同时启用了必需审查和过期审查,并且代� �修改提交已推送到批准的拉取请求分支,则批准将予驳回。 拉取请求必须经过再次审查和批准才可合并。
- 当多个打开的拉取请求时分别有指向同一提交的头部分支时,如果一个或两者有待定或被拒绝的审查,您将� 法合并它们。
- 如果存储库需要具有写入或管理员权限的人员批准审查,则具有这些权限的人员的任何审批都用绿色复选� �记表示,而不具备这些权限的人员的审批带有灰色复选� �记。 带有灰色复选� �记的审批不会影响拉取请求是否可以合并。
- 拉取请求作者� 法批准自己的拉取请求。