diff --git a/src/commit.ts b/src/commit.ts index 1857785..6abd35b 100644 --- a/src/commit.ts +++ b/src/commit.ts @@ -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); } diff --git a/test/conventionalCommit.test.ts b/test/conventionalCommit.test.ts index c1fa780..78db664 100644 --- a/test/conventionalCommit.test.ts +++ b/test/conventionalCommit.test.ts @@ -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 => {