Skip to content

Commit

Permalink
fix(changelog): add BREAKING CHANGE footer token value to changelog
Browse files Browse the repository at this point in the history
Before this change, footer token values for `BREAKING CHANGE` and
`BREAKING_CHANGE` were ignored.
  • Loading branch information
zbindenren committed Jan 4, 2021
1 parent 9cd0522 commit 2e070cd
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
1 change: 1 addition & 0 deletions internal/changelog/changelog_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ Closes: #12345`)
* **00000008**:
add a breaking change (#12345)
> this is the body of the breaking change
> breaks all
* **00000007**:
breaking change again
Expand Down
11 changes: 10 additions & 1 deletion internal/changelog/markdown.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,11 +79,20 @@ func (c *Commit) writeBreaking(w io.Writer) {
s.WriteString(")")
}

if c.Body != "" {
breakingMsg := c.BreakingMessage()

if c.Body != "" || breakingMsg != "" {
s.WriteString(nl)
}

if c.Body != "" {
s.WriteString(blockQuote(0, c.Body))
}

if breakingMsg != c.Header.Description {
s.WriteString(blockQuote(0, breakingMsg))
}

l := listItem(2, s.String())
w.Write([]byte(l))
}
Expand Down

0 comments on commit 2e070cd

Please sign in to comment.