Skip to content

Commit 72a7fd3

Browse files
committed
Don't allow adding or removing review requests for a merged PR
1 parent 475b6e8 commit 72a7fd3

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

routers/web/repo/issue.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2413,6 +2413,15 @@ func UpdatePullReviewRequest(ctx *context.Context) {
24132413
ctx.Status(http.StatusForbidden)
24142414
return
24152415
}
2416+
if issue.PullRequest.HasMerged {
2417+
log.Warn(
2418+
"UpdatePullReviewRequest: cannot add or remove a review for merged PR %-v#%d",
2419+
issue.Repo.FullName(), issue.PullRequest.Index,
2420+
)
2421+
ctx.Status(http.StatusForbidden)
2422+
return
2423+
}
2424+
24162425
if reviewID < 0 {
24172426
// negative reviewIDs represent team requests
24182427
if err := issue.Repo.LoadOwner(ctx); err != nil {

0 commit comments

Comments
 (0)