Skip to content

Commit 35cb786

Browse files
authored
[Patch] Fix closed PR also triggers Webhooks and actions (#23782)
Fix #23707 Cause by #23189 This PR is a quick fix that, when pushing commits to closed PR, webhook and actions also be triggered.
1 parent 71afbca commit 35cb786

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

services/pull/pull.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -294,6 +294,10 @@ func AddTestPullRequestTask(doer *user_model.User, repoID int64, branch string,
294294
}
295295
if err == nil {
296296
for _, pr := range prs {
297+
if pr.Issue.IsClosed {
298+
// The closed PR never trigger action or webhook
299+
continue
300+
}
297301
if newCommitID != "" && newCommitID != git.EmptySHA {
298302
changed, err := checkIfPRContentChanged(ctx, pr, oldCommitID, newCommitID)
299303
if err != nil {

0 commit comments

Comments
 (0)