Merge pull request #49 from rowbawts/dev

version bump
This commit is contained in:
Sebastian Cabrera 2023-08-30 20:37:47 -04:00 committed by GitHub
commit 2db2d6f43d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 4 deletions

View file

@ -1,6 +1,6 @@
package main
var version = "v0.04"
var version = "v0.05"
func main() {
initGitHubClient(version)

View file

@ -83,10 +83,12 @@ func webhookHandler(w http.ResponseWriter, r *http.Request) {
processIssuesEvent(event)
break
case *github.IssueCommentEvent:
eventLogin := event.GetComment().GetUser().GetLogin()
userType := strings.ToLower(event.GetComment().GetUser().GetType())
commentBody := event.GetComment().GetBody()
if !strings.Contains(eventLogin, "bot") && strings.Contains(commentBody, ":+1:") {
log.Println("User type:", userType, "Comment body:", commentBody)
if !strings.Contains(userType, "bot") && strings.Contains(commentBody, ":+1:") {
log.Println("Received Issue Comment Event: processing now!")
processIssueCommentEvent(event)
break
@ -141,10 +143,11 @@ func processIssueCommentEvent(event *github.IssueCommentEvent) {
// Check if there are thumbs up (:+1:) reactions
for _, comment := range comments {
userType := strings.ToLower(event.GetComment().GetUser().GetType())
commentAuthor := comment.GetUser().GetLogin()
commentBody := comment.GetBody()
if !strings.Contains(commentAuthor, "bot") && strings.Contains(commentBody, ":+1:") {
if !strings.Contains(userType, "bot") && strings.Contains(commentBody, ":+1:") {
_, exists := approvals[commentAuthor]
if !exists {
approvals[commentAuthor] = 1