Skip to content

Commit

Permalink
Merge pull request #52 from byu-oit/more-merge-commits
Browse files Browse the repository at this point in the history
Handle more merge commit formats
  • Loading branch information
GaryGSC authored Aug 10, 2023
2 parents d9c0dce + 93218a9 commit 6ceff58
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 6ceff58

Please sign in to comment.