Skip to content

Commit a2709f3

Browse files
sillyguodongGiteaBot
authored andcommitted
[Patch] Fix closed PR also triggers Webhooks and actions (go-gitea#23782)
Fix go-gitea#23707 Cause by go-gitea#23189 This PR is a quick fix that, when pushing commits to closed PR, webhook and actions also be triggered.
1 parent d15f20b commit a2709f3

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

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)