Merge pull request #24 from rowbawts/test
Downgrade go version for compatibility purposes
This commit is contained in:
commit
6c54a82295
2 changed files with 3 additions and 4 deletions
|
@ -1,6 +1,6 @@
|
|||
module bot
|
||||
|
||||
go 1.21
|
||||
go 1.20
|
||||
|
||||
require (
|
||||
github.com/bradleyfalzon/ghinstallation/v2 v2.6.0
|
||||
|
|
|
@ -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)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue