Skip to content

Commit

Permalink
[Patch] Fix closed PR also triggers Webhooks and actions (#23782)
Browse files Browse the repository at this point in the history
Fix #23707 
Cause by #23189
This PR is a quick fix that, when pushing commits to closed PR, webhook
and actions also be triggered.
  • Loading branch information
sillyguodong authored Mar 30, 2023
1 parent 71afbca commit 35cb786
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 35cb786

Please sign in to comment.