Skip to content

Commit 0cfd828

Browse files
Fix missing PR notifications when using both pulls_created and pulls_merged (#829)
Signed-off-by: Vadim Aleksandrov <[email protected]> Co-authored-by: Mattermost Build <[email protected]>
1 parent 496f268 commit 0cfd828

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

server/plugin/webhook.go

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -408,14 +408,20 @@ func (p *Plugin) postPullRequestEvent(event *github.PullRequestEvent) {
408408
continue
409409
}
410410

411-
if sub.PullsMerged() && action != actionClosed {
411+
if sub.PullsMerged() && action != actionClosed && !sub.PullsCreated() {
412412
continue
413413
}
414414

415-
if sub.PullsCreated() && action != actionOpened {
415+
if sub.PullsCreated() && action != actionOpened && !sub.PullsMerged() {
416416
continue
417417
}
418418

419+
if sub.PullsMerged() && sub.PullsCreated() {
420+
if action != actionClosed && action != actionOpened {
421+
continue
422+
}
423+
}
424+
419425
if p.excludeConfigOrgMember(event.GetSender(), sub) {
420426
continue
421427
}

0 commit comments

Comments
 (0)