From ac65c5e4a7bd965fcb6bad6132291a18ff94fdfe Mon Sep 17 00:00:00 2001 From: phips28 Date: Thu, 13 Feb 2020 20:36:18 +0100 Subject: [PATCH] minor: also listen on major/minor in commit message --- README.md | 4 ++-- index.js | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index abcff9d..2ace85c 100644 --- a/README.md +++ b/README.md @@ -10,9 +10,9 @@ you'll need to configured that workflow yourself. You can look to the ### Workflow * Based on the commit messages, increment the version from the lastest release. - * If the string "BREAKING CHANGE" is found anywhere in any of the commit messages or descriptions the major + * If the string "BREAKING CHANGE" or "major" is found anywhere in any of the commit messages or descriptions the major version will be incremented. - * If a commit message begins with the string "feat" then the minor version will be increased. This works + * If a commit message begins with the string "feat" or "minor" then the minor version will be increased. This works for most common commit metadata for feature additions: `"feat: new API"` and `"feature: new API"`. * All other changes will increment the patch version. * Push the bumped npm version in package.json back into the repo. diff --git a/index.js b/index.js index 00dd9ab..06d59f9 100644 --- a/index.js +++ b/index.js @@ -21,9 +21,10 @@ Toolkit.run(async tools => { } let version = 'patch' - if (messages.map(message => message.includes('BREAKING CHANGE')).includes(true)) { + if (messages.map(message => message.includes('BREAKING CHANGE') || message.includes('major')).includes(true)) { version = 'major' - } else if (messages.map(message => message.toLowerCase().startsWith('feat')).includes(true)) { + } else if (messages.map( + message => message.toLowerCase().startsWith('feat') || message.toLowerCase().includes('minor')).includes(true)) { version = 'minor' }