mirror of
https://github.com/macports/mpbot-github.git
synced 2026-07-13 03:18:39 -07:00
improve test for 'update' label
The test for an update is too specific. It misses several cases: update PORT to NNN PORT: update MAINPORT to NNN, SUBPORT to NNN Some people might want to use the type `- [x] update` in the body.
This commit is contained in:
committed by
Zero King
parent
bb29ea01f7
commit
6f8aa8f253
@@ -174,13 +174,13 @@ func (receiver *Receiver) processPullRequest(event *github.PullRequestEvent) {
|
||||
if isSubmission {
|
||||
typeLabels = appendIfUnique(typeLabels, "type: submission")
|
||||
}
|
||||
if strings.Contains(strings.ToLower(*event.PullRequest.Title), ": update to") {
|
||||
if strings.Contains(strings.ToLower(*event.PullRequest.Title), ": update") || strings.HasPrefix(strings.ToLower(*event.PullRequest.Title), "update") {
|
||||
typeLabels = appendIfUnique(typeLabels, "type: update")
|
||||
}
|
||||
if cveRegexp.FindString(*event.PullRequest.Title) != "" || cveRegexp.FindString(*event.PullRequest.Body) != "" {
|
||||
typeLabels = appendIfUnique(typeLabels, "type: security fix")
|
||||
}
|
||||
typesFromBody := []string{"bugfix", "enhancement", "security fix"}
|
||||
typesFromBody := []string{"bugfix", "enhancement", "security fix", "update"}
|
||||
for _, t := range typesFromBody {
|
||||
if strings.Contains(*event.PullRequest.Body, "[x] "+t) {
|
||||
typeLabels = appendIfUnique(typeLabels, "type: "+t)
|
||||
|
||||
Reference in New Issue
Block a user