diff --git a/approval.go b/approval.go index d1bc050..db2dbae 100644 --- a/approval.go +++ b/approval.go @@ -147,7 +147,7 @@ func isApproved(commentBody string) (bool, error) { func isDenied(commentBody string) (bool, error) { for _, deniedWord := range deniedWords { - matched, err := regexp.MatchString(fmt.Sprintf("(?i)^%s[.!]?$", deniedWord), commentBody) + matched, err := regexp.MatchString(fmt.Sprintf("(?i)^%s[.!]*\n*$", deniedWord), commentBody) if err != nil { return false, err } diff --git a/approval_test.go b/approval_test.go index 5d7f219..4ff0c83 100644 --- a/approval_test.go +++ b/approval_test.go @@ -316,6 +316,11 @@ func TestDeniedCommentBody(t *testing.T) { commentBody: "this is just some random comment", isSuccess: false, }, + { + name: "denied_with_newline", + commentBody: "denied\n", + isSuccess: true, + }, } for _, testCase := range testCases {