Merge pull request #24 from rowbawts/test

Downgrade go version for compatibility purposes
This commit is contained in:
Sebastian Cabrera 2023-08-28 20:17:12 -04:00 committed by GitHub
commit 6c54a82295
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 4 deletions

View file

@ -1,6 +1,6 @@
module bot
go 1.21
go 1.20
require (
github.com/bradleyfalzon/ghinstallation/v2 v2.6.0

View file

@ -90,7 +90,7 @@ func processIssueCommentEvent(event *github.IssueCommentEvent) {
repo := event.GetRepo().GetName()
prNumber := event.GetIssue().GetNumber()
reactionCount := 0
reactionCountGoal := 2
reactionCountGoal := 5
if event.GetIssue().IsPullRequest() {
comments, _, err := client.Issues.ListComments(ctx, owner, repo, prNumber, nil)
@ -102,7 +102,6 @@ func processIssueCommentEvent(event *github.IssueCommentEvent) {
// Check if there are thumbs up (:+1:) reactions
for _, comment := range comments {
if strings.Contains(comment.GetBody(), "+1") && !strings.Contains(comment.GetUser().GetLogin(), "bot") {
fmt.Println(comment.GetUser().GetLogin())
reactionCount++
}
}
@ -132,7 +131,7 @@ func processIssueCommentEvent(event *github.IssueCommentEvent) {
return
} else {
commentText := "Current :+1: count is (#{reactionCount}) need (#{reactionRemainingCount}) more to merge"
commentText := "Votes: (#{reactionCount})/(#{reactionRemainingCount})"
commentText = strings.Replace(commentText, "(#{reactionCount})", strconv.Itoa(reactionCount), 1)
commentText = strings.Replace(commentText, "(#{reactionRemainingCount})", strconv.Itoa(reactionCountGoal-reactionCount), 1)