Skip to content

Commit

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

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.
  • Loading branch information
sillyguodong authored and GiteaBot committed Mar 31, 2023
1 parent d15f20b commit a2709f3
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions services/pull/pull.go
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 a2709f3

Please sign in to comment.