Only merge if the comment body contains a thumbs up emoji
This commit is contained in:
parent
54a969a4da
commit
9513ba8897
1 changed files with 3 additions and 2 deletions
|
@ -86,7 +86,7 @@ func webhookHandler(w http.ResponseWriter, r *http.Request) {
|
||||||
eventLogin := event.GetComment().GetUser().GetLogin()
|
eventLogin := event.GetComment().GetUser().GetLogin()
|
||||||
commentBody := event.GetComment().GetBody()
|
commentBody := event.GetComment().GetBody()
|
||||||
|
|
||||||
if !strings.Contains(eventLogin, "bot") && strings.Contains(commentBody, "+1") {
|
if !strings.Contains(eventLogin, "bot") && strings.Contains(commentBody, ":+1:") {
|
||||||
log.Println("Received Issue Comment Event: processing now!")
|
log.Println("Received Issue Comment Event: processing now!")
|
||||||
processIssueCommentEvent(event)
|
processIssueCommentEvent(event)
|
||||||
break
|
break
|
||||||
|
@ -142,8 +142,9 @@ 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 {
|
||||||
commentAuthor := comment.GetUser().GetLogin()
|
commentAuthor := comment.GetUser().GetLogin()
|
||||||
|
commentBody := comment.GetBody()
|
||||||
|
|
||||||
if !strings.Contains(commentAuthor, "bot") {
|
if !strings.Contains(commentAuthor, "bot") && strings.Contains(commentBody, ":+1:") {
|
||||||
_, exists := approvals[commentAuthor]
|
_, exists := approvals[commentAuthor]
|
||||||
if !exists {
|
if !exists {
|
||||||
approvals[commentAuthor] = 1
|
approvals[commentAuthor] = 1
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue