From ab791d324de07ab4d41a07620fab963c4bd119f6 Mon Sep 17 00:00:00 2001 From: Md Fasihul Kabir Date: Wed, 10 Mar 2021 15:34:41 +0600 Subject: [PATCH] supported preid for default prerelease version --- index.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/index.js b/index.js index eac350e..5765323 100644 --- a/index.js +++ b/index.js @@ -37,7 +37,7 @@ Toolkit.run(async tools => { let version = process.env.INPUT_DEFAULT || 'patch' let foundWord = null - + let preid = process.env.INPUT_PREID; if (messages.some( message => /^([a-zA-Z]+)(\(.+\))?(\!)\:/.test(message) || majorWords.some(word => message.includes(word)))) { version = 'major' @@ -52,14 +52,18 @@ Toolkit.run(async tools => { } } ))) { - const preid = process.env.INPUT_PREID || foundWord.split('-')[1] - version = `prerelease --preid=${preid}` + preid = foundWord.split('-')[1] + version = 'prerelease' } else if (Array.isArray(patchWords) && patchWords.length) { if (!messages.some(message => patchWords.some(word => message.includes(word)))) { version = null } } + if (version === 'prerelease' && preid) { + version = `${version} --preid=${preid}` + } + if (version === null) { tools.exit.success('No version keywords found, skipping bump.') return