Skip to content

Commit bb5e69b

Browse files
authored
fix: when parsing multiple messages from a single commit, require 2 newlines (#2390)
* fix: when parsing multiple messages from a single commit, require 2 newlines * test: fix test name * try optional windows newlines
1 parent 2889497 commit bb5e69b

File tree

3 files changed

+111
-1
lines changed

3 files changed

+111
-1
lines changed

src/commit.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -389,7 +389,7 @@ function splitMessages(message: string): string[] {
389389

390390
const conventionalCommits = messages[0]
391391
.split(
392-
/\n(?=(?:feat|fix|docs|style|refactor|perf|test|build|ci|chore|revert)(?:\(.*?\))?: )/
392+
/\r?\n\r?\n(?=(?:feat|fix|docs|style|refactor|perf|test|build|ci|chore|revert)(?:\(.*?\))?: )/
393393
)
394394
.filter(Boolean);
395395
return [...conventionalCommits, ...messages.slice(1)];

test/commits.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,14 @@ describe('parseConventionalCommits', () => {
5757
expect(conventionalCommits[1].scope).is.null;
5858
});
5959

60+
it('can parse multiple commit messages requires 2 line breaks', async () => {
61+
const commits = [buildCommitFromFixture('dependabot')];
62+
const conventionalCommits = parseConventionalCommits(commits);
63+
expect(conventionalCommits).lengthOf(1);
64+
expect(conventionalCommits[0].type).to.equal('fix');
65+
expect(conventionalCommits[0].scope).is.null;
66+
});
67+
6068
it('handles BREAKING CHANGE body', async () => {
6169
const commits = [buildCommitFromFixture('breaking-body')];
6270
const conventionalCommits = parseConventionalCommits(commits);
Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
fix: bump release-please from 16.13.0 to 16.14.0 (#1032)
2+
3+
Bumps [release-please](https://github.com/googleapis/release-please)
4+
from 16.13.0 to 16.14.0.
5+
<details>
6+
<summary>Release notes</summary>
7+
<p><em>Sourced from <a
8+
href="https://github.com/googleapis/release-please/releases">release-please's
9+
releases</a>.</em></p>
10+
<blockquote>
11+
<h2>v16.14.0</h2>
12+
<h2><a
13+
href="https://github.com/googleapis/release-please/compare/v16.13.0...v16.14.0">16.14.0</a>
14+
(2024-09-17)</h2>
15+
<h3>Features</h3>
16+
<ul>
17+
<li>handle multiple commits in a single message (<a
18+
href="https://redirect.github.com/googleapis/release-please/issues/2358">#2358</a>)
19+
(<a
20+
href="https://github.com/googleapis/release-please/commit/ec41c38422fc23c6671f4ee7e4f09e9e120ab751">ec41c38</a>)</li>
21+
</ul>
22+
</blockquote>
23+
</details>
24+
<details>
25+
<summary>Changelog</summary>
26+
<p><em>Sourced from <a
27+
href="https://github.com/googleapis/release-please/blob/main/CHANGELOG.md">release-please's
28+
changelog</a>.</em></p>
29+
<blockquote>
30+
<h2><a
31+
href="https://github.com/googleapis/release-please/compare/v16.13.0...v16.14.0">16.14.0</a>
32+
(2024-09-17)</h2>
33+
<h3>Features</h3>
34+
<ul>
35+
<li>handle multiple commits in a single message (<a
36+
href="https://redirect.github.com/googleapis/release-please/issues/2358">#2358</a>)
37+
(<a
38+
href="https://github.com/googleapis/release-please/commit/ec41c38422fc23c6671f4ee7e4f09e9e120ab751">ec41c38</a>)</li>
39+
</ul>
40+
</blockquote>
41+
</details>
42+
<details>
43+
<summary>Commits</summary>
44+
<ul>
45+
<li><a
46+
href="https://github.com/googleapis/release-please/commit/288949797c6bfd95e08d74a6222e7d26e0020a7c"><code>2889497</code></a>
47+
chore(main): release 16.14.0 (<a
48+
href="https://redirect.github.com/googleapis/release-please/issues/2383">#2383</a>)</li>
49+
<li><a
50+
href="https://github.com/googleapis/release-please/commit/ec41c38422fc23c6671f4ee7e4f09e9e120ab751"><code>ec41c38</code></a>
51+
feat: handle multiple commits in a single message (<a
52+
href="https://redirect.github.com/googleapis/release-please/issues/2358">#2358</a>)</li>
53+
<li>See full diff in <a
54+
href="https://github.com/googleapis/release-please/compare/v16.13.0...v16.14.0">compare
55+
view</a></li>
56+
</ul>
57+
</details>
58+
<br />
59+
60+
61+
[![Dependabot compatibility
62+
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=release-please&package-manager=npm_and_yarn&previous-version=16.13.0&new-version=16.14.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)
63+
64+
Dependabot will resolve any conflicts with this PR as long as you don't
65+
alter it yourself. You can also trigger a rebase manually by commenting
66+
`@dependabot rebase`.
67+
68+
[//]: # (dependabot-automerge-start)
69+
[//]: # (dependabot-automerge-end)
70+
71+
---
72+
73+
<details>
74+
<summary>Dependabot commands and options</summary>
75+
<br />
76+
77+
You can trigger Dependabot actions by commenting on this PR:
78+
- `@dependabot rebase` will rebase this PR
79+
- `@dependabot recreate` will recreate this PR, overwriting any edits
80+
that have been made to it
81+
- `@dependabot merge` will merge this PR after your CI passes on it
82+
- `@dependabot squash and merge` will squash and merge this PR after
83+
your CI passes on it
84+
- `@dependabot cancel merge` will cancel a previously requested merge
85+
and block automerging
86+
- `@dependabot reopen` will reopen this PR if it is closed
87+
- `@dependabot close` will close this PR and stop Dependabot recreating
88+
it. You can achieve the same result by closing it manually
89+
- `@dependabot show <dependency name> ignore conditions` will show all
90+
of the ignore conditions of the specified dependency
91+
- `@dependabot ignore this major version` will close this PR and stop
92+
Dependabot creating any more for this major version (unless you reopen
93+
the PR or upgrade to it yourself)
94+
- `@dependabot ignore this minor version` will close this PR and stop
95+
Dependabot creating any more for this minor version (unless you reopen
96+
the PR or upgrade to it yourself)
97+
- `@dependabot ignore this dependency` will close this PR and stop
98+
Dependabot creating any more for this dependency (unless you reopen the
99+
PR or upgrade to it yourself)
100+
101+
102+
</details>

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy