Skip to content

Commit 26fe4d0

Browse files
improved logic
1 parent fb7ac8f commit 26fe4d0

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

server/plugin/webhook.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -438,9 +438,13 @@ func (p *Plugin) postPullRequestEvent(event *github.PullRequestEvent) {
438438

439439
if action == actionOpened {
440440
prNotificationType := "newPR"
441-
if isPRInDraftState && p.configuration.GetNotificationForDraftPRs {
441+
if isPRInDraftState {
442+
if !p.configuration.GetNotificationForDraftPRs {
443+
return // Draft PR notifications are disabled
444+
}
442445
prNotificationType = "newDraftPR"
443446
}
447+
444448
newPRMessage, err := renderTemplate(prNotificationType, GetEventWithRenderConfig(event, sub))
445449
if err != nil {
446450
p.client.Log.Warn("Failed to render template", "error", err.Error())

0 commit comments

Comments
 (0)