Skip to content

Commit

Permalink
feat: support merges of remote branches
Browse files Browse the repository at this point in the history
  • Loading branch information
tobias-kleinschmidt-fnt authored and Kevin-de-Jong committed Jun 17, 2024
1 parent 24a27c5 commit 049cd96
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/commit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ export function getFooterElementsFromParagraph(
function subjectIsMergePattern(subject: string): boolean {
const githubMergeRegex = /^Merge pull request #(\d+) from '?(.*)'?$/;
const bitbucketMergeRegex = /^Merged in '?(.*)'? \(pull request #(\d+)\)$/;
const gitlabMergeRegex = /^Merge branch '?(.*?)'? into '?(.*?)'?$/;
const gitlabMergeRegex = /^Merge( remote-tracking)? branch '?(.*?)'? into '?(.*?)'?$/;

return githubMergeRegex.test(subject) || bitbucketMergeRegex.test(subject) || gitlabMergeRegex.test(subject);
}
Expand Down
3 changes: 3 additions & 0 deletions test/conventionalCommit.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -310,6 +310,9 @@ describe("Merge commits", () => {
{ message: "Merge branch 'ci/some-branch' into 'main'" },
{ message: "Merge branch 'ci/some-branch' into main" },
{ message: "Merge branch ci/some-branch into main" },
{ message: "Merge remote-tracking branch 'ci/some-branch' into 'main'" },
{ message: "Merge remote-tracking branch 'ci/some-branch' into main" },
{ message: "Merge remote-tracking branch ci/some-branch into main" },
];

it.each(tests)("$message", test => {
Expand Down

0 comments on commit 049cd96

Please sign in to comment.