diff --git a/mjolnir.go b/mjolnir.go index 0c8731e..6cc2d48 100644 --- a/mjolnir.go +++ b/mjolnir.go @@ -12,9 +12,9 @@ import ( ) var ( - globalFixesIssueRE = regexp.MustCompile(`(?i)(?:close|closes|closed|fix|fixes|fixed|resolve|resolves|resolved)(\s+#\d+(?:[\s,]+#\d+)*(?:[\n\r\s,]|$))`) + globalFixesIssueRE = regexp.MustCompile(`(?i)(?:close|closes|closed|fix|fixes|fixed|resolve|resolves|resolved)(\s+#\d+(?:[\s,]+#\d+)*\.?(?:[\n\r\s,]|$))`) fixesIssueRE = regexp.MustCompile(`[\s,]+#`) - cleanNumberRE = regexp.MustCompile(`[\n\r\s,]`) + cleanNumberRE = regexp.MustCompile(`[.\n\r\s,]`) ) // closeRelatedIssues Closes issues listed in the PR description. diff --git a/mjolnir_test.go b/mjolnir_test.go index cc4cdd4..179f3a5 100644 --- a/mjolnir_test.go +++ b/mjolnir_test.go @@ -69,6 +69,21 @@ func Test_parseIssueFixes(t *testing.T) { `, expectedNumbers: []int{math.MaxInt64}, }, + { + name: "valid issue numbers ends with a dot", + text: ` + Fixes #13 #14, #15,#16. +`, + expectedNumbers: []int{13, 14, 15, 16}, + }, + { + name: "multiple lines end with a dot", + text: ` + Fixes: #13,#14. + Fixes: #15,#16. +`, + expectedNumbers: []int{13, 14, 15, 16}, + }, } for _, test := range testCases {