Skip to content

Commit 948c7ef

Browse files
Fixed rendering of draft PRs as normal
1 parent fb7ac8f commit 948c7ef

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

server/plugin/webhook.go

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

439439
if action == actionOpened {
440440
prNotificationType := "newPR"
441-
if isPRInDraftState && p.configuration.GetNotificationForDraftPRs {
441+
442+
if isPRInDraftState && !p.configuration.GetNotificationForDraftPRs {
443+
return
444+
}
445+
446+
if isPRInDraftState {
442447
prNotificationType = "newDraftPR"
443448
}
449+
444450
newPRMessage, err := renderTemplate(prNotificationType, GetEventWithRenderConfig(event, sub))
445451
if err != nil {
446452
p.client.Log.Warn("Failed to render template", "error", err.Error())

0 commit comments

Comments
 (0)