Merge pull request #20 from rowbawts/test

Merging based on reactions
This commit is contained in:
openest-source-bot[bot] 2023-08-28 23:08:39 +00:00 committed by GitHub
commit 528a7ac5cc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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{