summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsillyguodong <33891828+sillyguodong@users.noreply.github.com>2023-03-30 16:26:02 +0800
committerGitHub <noreply@github.com>2023-03-30 16:26:02 +0800
commit35cb786ca1dd6d12963ac7067945065b271f36ad (patch)
treea04e2d712993932c0b866ac657cdbe07f7589f78
parent71afbcafa9f8200af3f2e4848fad605116159c7f (diff)
downloadgitea-35cb786ca1dd6d12963ac7067945065b271f36ad.tar.gz
gitea-35cb786ca1dd6d12963ac7067945065b271f36ad.zip
[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.
-rw-r--r--services/pull/pull.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/services/pull/pull.go b/services/pull/pull.go
index e1d5a6f86d..fe2f002010 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 {