Skip to content

Commit

Permalink
Handle more merge commit formats
Browse files Browse the repository at this point in the history
  • Loading branch information
GaryGSC committed Aug 7, 2023
1 parent d9c0dce commit 93218a9
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion dist/index.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions utils.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const pullRequestMergeCommitRegex = /^Merge pull request #\d+ from \S+/
const branchMergeCommitRegex = /Merge (remote-tracking )?branch \S+( of https:\/\/github\.com\/\S+)? into \S+/
const pullRequestMergeCommitRegex = /^Merge pull request #\d+( from \S+)?/
const branchMergeCommitRegex = /Merge (remote-tracking )?branch \S+( of https:\/\/github\.com\/\S+)?( into \S+)?/
function isMergeCommitMessage (message) {
return !!(message.match(pullRequestMergeCommitRegex) || message.match(branchMergeCommitRegex))
}
Expand Down
4 changes: 3 additions & 1 deletion utils.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ describe('isMergeCommitMessage', () => {
'Merge branch dev into prd',
'Merge branch \'idHash\' of https://github.com/byu-oit/ces-adm-sv-recommendations into idHash',
'Merge remote-tracking branch \'origin/dev\' into jacobs27',
'Merge pull request #1078 from byu-oit/dev'
'Merge pull request #1078 from byu-oit/dev',
'Merge pull request #327',
'Merge branch \'dev\''
]
for (const message of mergeCommits) {
test(message, () => {
Expand Down

0 comments on commit 93218a9

Please sign in to comment.