1
0
mirror of https://github.com/go-gitea/gitea.git synced 2024-09-01 14:56:30 +00:00

[Patch] Fix closed PR also triggers Webhooks and actions () ()

Backport  by @sillyguodong

Fix  
Cause by 
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>
This commit is contained in:
Giteabot 2023-03-31 02:29:23 -04:00 committed by GitHub
parent a1460333dc
commit a04535e212
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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 {