@@ -651,50 +651,35 @@ func (p *Plugin) postIssueEvent(event *github.IssuesEvent) {
651
651
652
652
func (p * Plugin ) postPushEvent (event * github.PushEvent ) {
653
653
repo := event .GetRepo ()
654
- fmt .Println ("postPushEvent 1" )
655
654
656
655
subs := p .GetSubscribedChannelsForRepository (ConvertPushEventRepositoryToRepository (repo ))
657
- fmt .Println ("postPushEvent 2" )
658
656
if len (subs ) == 0 {
659
- fmt .Println ("postPushEvent 3" )
660
657
return
661
658
}
662
659
663
660
commits := event .Commits
664
- fmt .Println ("postPushEvent 4" )
665
661
if len (commits ) == 0 {
666
- fmt .Println ("postPushEvent 5" )
667
662
return
668
663
}
669
664
670
665
setShowAuthorInCommitNotification (p .configuration .ShowAuthorInCommitNotification )
671
- fmt .Println ("postPushEvent 6" )
672
666
pushedCommitsMessage , err := renderTemplate ("pushedCommits" , event )
673
- fmt .Println ("postPushEvent 7" )
674
667
if err != nil {
675
- fmt .Println ("postPushEvent 8" )
676
668
p .client .Log .Warn ("Failed to render template" , "error" , err .Error ())
677
669
return
678
670
}
679
671
680
672
for _ , sub := range subs {
681
- fmt .Println ("postPushEvent 9" )
682
673
if ! sub .Pushes () {
683
- fmt .Println ("postPushEvent 10" )
684
674
continue
685
675
}
686
- fmt .Println ("postPushEvent 11" )
687
676
if p .excludeConfigOrgMember (event .GetSender (), sub ) {
688
- fmt .Println ("postPushEvent 12" )
689
677
continue
690
678
}
691
- fmt .Println ("postPushEvent 13" )
692
679
post := p .makeBotPost (pushedCommitsMessage , "custom_git_push" )
693
680
694
681
post .ChannelId = sub .ChannelID
695
- fmt .Println ("postPushEvent 14" )
696
682
if err = p .client .Post .CreatePost (post ); err != nil {
697
- fmt .Println ("postPushEvent 15" )
698
683
p .client .Log .Warn ("Error webhook post" , "post" , post , "error" , err .Error ())
699
684
}
700
685
}
0 commit comments