mirror of
1
Fork 0

Avoid opening/closing PRs which are already merged (#25883) (#26108)

(cherry picked from commit 53586e9d60)
This commit is contained in:
yp05327 2023-07-26 02:31:09 +09:00 committed by Earl Warren
parent 459d708d27
commit 13341af69e
No known key found for this signature in database
GPG Key ID: 0579CB2928A78A00
1 changed files with 7 additions and 0 deletions

View File

@ -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) {