Skip to content

Commit

Permalink
Avoid opening/closing PRs which are already merged (#25883) (#26108)
Browse files Browse the repository at this point in the history
  • Loading branch information
yp05327 authored Jul 25, 2023
1 parent 81f5d5b commit 53586e9
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions routers/web/repo/issue.go
Original file line number Diff line number Diff line change
Expand Up @@ -2654,6 +2654,13 @@ func UpdateIssueStatus(ctx *context.Context) {
return
}
for _, issue := range issues {
if err := issue.LoadPullRequest(ctx); err != nil {
ctx.ServerError("LoadPullRequests", err)
return
}
if issue.IsPull && issue.PullRequest.HasMerged {
continue
}
if issue.IsClosed != isClosed {
if err := issue_service.ChangeStatus(issue, ctx.Doer, "", isClosed); err != nil {
if issues_model.IsErrDependenciesLeft(err) {
Expand Down

0 comments on commit 53586e9

Please sign in to comment.