From 368f06e58454ecfdfa10c18c8ef17e402635aa12 Mon Sep 17 00:00:00 2001 From: okseby Date: Mon, 28 Aug 2023 19:07:01 -0400 Subject: [PATCH] Ok we were counting the thumbs up from the bot which is definitely NOT what we want --- bot/utils.go | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/bot/utils.go b/bot/utils.go index ddc90e0..a562ae6 100644 --- a/bot/utils.go +++ b/bot/utils.go @@ -51,7 +51,7 @@ func webhookHandler(w http.ResponseWriter, r *http.Request) { processIssuesEvent(event) break case *github.IssueCommentEvent: - if event.GetComment().GetUser().GetLogin() != "openest-source-bot[bot]" { + if !strings.Contains(event.GetComment().GetUser().GetLogin(), "bot") { processIssueCommentEvent(event) break } @@ -101,11 +101,9 @@ func processIssueCommentEvent(event *github.IssueCommentEvent) { // Check if there are thumbs up (:+1:) reactions for _, comment := range comments { - if strings.Contains(comment.GetBody(), "+1") { + if strings.Contains(comment.GetBody(), "+1") && !strings.Contains(comment.GetUser().GetLogin(), "bot") { reactionCount++ - fmt.Println(comment.GetBody()) - if reactionCount >= reactionCountGoal { // Merge the pull request merge := &github.PullRequestOptions{