feat: add RawHeader in conventional commit

main
hau 2020-11-10 15:47:54 +07:00
parent 3ab8e17719
commit 758c5173c8
4 changed files with 6 additions and 0 deletions

View File

@ -18,6 +18,7 @@ var (
)
type Commit struct {
RawHeader string
Type string
Scope string
Description string
@ -44,6 +45,8 @@ func parseHeader(header string, commit *Commit) error {
return errors.New("wrong header format")
}
commit.RawHeader = header
headerSubmatches := headerRegex.FindStringSubmatch(header)
commit.Type = headerSubmatches[1]

View File

@ -1,4 +1,5 @@
{
"RawHeader": "docs: correct spelling of CHANGELOG",
"Type": "docs",
"Scope": "",
"Description": "correct spelling of CHANGELOG"

View File

@ -1,4 +1,5 @@
{
"RawHeader": "refactor!: drop support for Node 6",
"Type": "refactor",
"Scope": "",
"Description": "drop support for Node 6"

View File

@ -1,4 +1,5 @@
{
"RawHeader": "feat(lang): add polish language",
"Type": "feat",
"Scope": "lang",
"Description": "add polish language"