diff --git a/internal/agreement.go b/internal/agreement.go index caba0a0..3fa0898 100644 --- a/internal/agreement.go +++ b/internal/agreement.go @@ -1,5 +1,9 @@ package internal +import ( + "strings" +) + type AgreementOptions struct { Threshold int NeedsConsensus bool @@ -14,7 +18,7 @@ func AgreementReached(members []string, votes map[string]bool, opts *AgreementOp } numFor := 0 for _, member := range members { - isFor, voted := votes[member] + isFor, voted := votes[strings.ToLower(member)] // cases where members do not have a vote in votes if !voted { continue diff --git a/internal/webhook.go b/internal/webhook.go index a58459f..7776c38 100644 --- a/internal/webhook.go +++ b/internal/webhook.go @@ -5,6 +5,7 @@ import ( "fmt" "io/ioutil" "net/http" + "strings" "time" "github.com/google/go-github/github" @@ -138,9 +139,9 @@ func GenerateReviewMap(reviews []*github.PullRequestReview) map[string]bool { switch *review.State { // Cases outside of these 2 do not matter case "APPROVED": - reviewMap[*review.User.Login] = true + reviewMap[strings.ToLower(*review.User.Login)] = true case "CHANGES_REQUESTED": - reviewMap[*review.User.Login] = false + reviewMap[strings.ToLower(*review.User.Login)] = false } } return reviewMap