Skip to content

Commit a04535e

Browse files
[Patch] Fix closed PR also triggers Webhooks and actions (#23782) (#23834)
Backport #23782 by @sillyguodong Fix #23707 Cause by #23189 This PR is a quick fix that, when pushing commits to closed PR, webhook and actions also be triggered. Co-authored-by: sillyguodong <33891828+sillyguodong@users.noreply.github.com>
1 parent a146033 commit a04535e

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

Diff for: services/pull/pull.go

+4
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)