Merge pull request #18 from rowbawts/test

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

View file

@ -19,23 +19,11 @@ var client = github.NewClient(&http.Client{Transport: itr})
var ctx = context.Background()
func initGitHubClient() {
readme, _, err := client.Repositories.GetReadme(ctx, "rowbawts", "theopenestsource", nil)
if err != nil {
fmt.Println(err)
return
}
content, err := readme.GetContent()
if err != nil {
fmt.Println(err)
return
}
fmt.Println(content)
log.Println("Initializing......")
}
func listenForWebhook() {
fmt.Println("Listening on :3333......")
log.Println("Listening on :3333......")
http.HandleFunc("/", webhookHandler)
@ -115,8 +103,6 @@ func processIssueCommentEvent(event *github.IssueCommentEvent) {
for _, comment := range comments {
if strings.Contains(comment.GetBody(), "+1") {
reactionCount++
}
}
if reactionCount >= reactionCountGoal {
// Merge the pull request
@ -148,6 +134,8 @@ func processIssueCommentEvent(event *github.IssueCommentEvent) {
}
}
}
}
}
}
func processPullRequestEvent(event *github.PullRequestEvent) {