Skip to content

Commit

Permalink
[Patch] Fix closed PR also triggers Webhooks and actions (#23782) (#2…
Browse files Browse the repository at this point in the history
…3834)

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>
  • Loading branch information
GiteaBot and sillyguodong committed Mar 31, 2023
1 parent a146033 commit a04535e
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions services/pull/pull.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit a04535e

Please sign in to comment.