cherry-bot
cherry-bot copied to clipboard
bug template should not commit when partial match '/info' substring in comment
Bug Report
/info command should use full match, not partial match. eg: when has '/information' in comment, should not trigger add template function root cause: in the page, https://github.com/pingcap-incubator/cherry-bot/blob/master/pkg/providers/add-template/event.go should not use if len(temMatches) > 0 && strings.TrimSpace(temMatches[0]) == "/info" { should use if comment == '/info'
issueID := event.GetIssue().GetNumber()
fmt.Println(issueID)
//fmt.Println(comment)
temMatches := templatePattern.FindStringSubmatch(comment)
fmt.Println("temMatches:", temMatches)
if len(temMatches) > 0 && strings.TrimSpace(temMatches[0]) == "/info" {
e := c.addTemplate(issueID)
if e != nil {
err := errors.Wrap(e, "add template to comment fail")
return err
}
}
return nil
}
/label type/feature-requet
These labels are not found type/feature-requet.
/label type/feature-request