commit
01e6b69770
1 changed files with 8 additions and 3 deletions
11
bot/utils.go
11
bot/utils.go
|
@ -136,11 +136,16 @@ func processIssueCommentEvent(event *github.IssueCommentEvent) {
|
||||||
|
|
||||||
// Check if there are thumbs up (:+1:) reactions
|
// Check if there are thumbs up (:+1:) reactions
|
||||||
for _, comment := range comments {
|
for _, comment := range comments {
|
||||||
if strings.Contains(comment.GetBody(), "+1") && !strings.Contains(comment.GetUser().GetLogin(), "bot") {
|
commentAuthor := comment.GetUser().GetLogin()
|
||||||
|
|
||||||
|
if strings.Contains(comment.GetBody(), "+1") && !strings.Contains(commentAuthor, "bot") {
|
||||||
value, exists := approvals[prNumber]
|
value, exists := approvals[prNumber]
|
||||||
if !(exists && strings.Contains(value, comment.GetUser().GetLogin())) {
|
if exists && !strings.Contains(value, commentAuthor) {
|
||||||
reactionCount++
|
reactionCount++
|
||||||
approvals[prNumber] = comment.GetUser().GetLogin()
|
approvals[prNumber] = commentAuthor
|
||||||
|
} else if !exists {
|
||||||
|
reactionCount++
|
||||||
|
approvals[prNumber] = commentAuthor
|
||||||
} else {
|
} else {
|
||||||
// Respond with a comment
|
// Respond with a comment
|
||||||
comment := &github.IssueComment{
|
comment := &github.IssueComment{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue