From a2709f3065e20964cf5e4413f0e4c53f31415282 Mon Sep 17 00:00:00 2001 From: sillyguodong <33891828+sillyguodong@users.noreply.github.com> Date: Thu, 30 Mar 2023 16:26:02 +0800 Subject: [PATCH] [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. --- services/pull/pull.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/services/pull/pull.go b/services/pull/pull.go index a5541b84606b..73d7c571484c 100644 --- a/services/pull/pull.go +++ b/services/pull/pull.go @@ -294,6 +294,10 @@ func AddTestPullRequestTask(doer *user_model.User, repoID int64, branch string, } if err == nil { for _, pr := range prs { + if pr.Issue.IsClosed { + // The closed PR never trigger action or webhook + continue + } if newCommitID != "" && newCommitID != git.EmptySHA { changed, err := checkIfPRContentChanged(ctx, pr, oldCommitID, newCommitID) if err != nil {