mirror of
https://github.com/thegeeklab/git-sv.git
synced 2024-11-21 22:10:39 +00:00
parent
a1498c0832
commit
946024ce0b
@ -11,6 +11,7 @@ const (
|
|||||||
breakingChangeFooterKey = "BREAKING CHANGE"
|
breakingChangeFooterKey = "BREAKING CHANGE"
|
||||||
breakingChangeMetadataKey = "breaking-change"
|
breakingChangeMetadataKey = "breaking-change"
|
||||||
issueMetadataKey = "issue"
|
issueMetadataKey = "issue"
|
||||||
|
messageRegexGroupName = "message"
|
||||||
)
|
)
|
||||||
|
|
||||||
// CommitMessage is a message using conventional commits.
|
// CommitMessage is a message using conventional commits.
|
||||||
@ -205,8 +206,8 @@ func (p MessageProcessorImpl) Parse(subject, body string) CommitMessage {
|
|||||||
filteredSubject := subject
|
filteredSubject := subject
|
||||||
if p.messageCfg.MessageSelector != "" {
|
if p.messageCfg.MessageSelector != "" {
|
||||||
subjectRegex := regexp.MustCompile(p.messageCfg.MessageSelector)
|
subjectRegex := regexp.MustCompile(p.messageCfg.MessageSelector)
|
||||||
subjectMessageIndex := regex.SubexpIndex("message")
|
subjectMessageIndex := subjectRegex.SubexpIndex(messageRegexGroupName)
|
||||||
subjectMatch := regex.FindStringSubmatch(subject)
|
subjectMatch := subjectRegex.FindStringSubmatch(subject)
|
||||||
|
|
||||||
filteredSubject = subjectMatch[subjectMessageIndex]
|
filteredSubject = subjectMatch[subjectMessageIndex]
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user