Merge pull request #78 from fkrafi/bug/support-preid-for-default-with-prerelease
supported preid for default prerelease version
This commit is contained in:
commit
ab52598722
10
index.js
10
index.js
|
@ -37,7 +37,7 @@ Toolkit.run(async tools => {
|
||||||
|
|
||||||
let version = process.env.INPUT_DEFAULT || 'patch'
|
let version = process.env.INPUT_DEFAULT || 'patch'
|
||||||
let foundWord = null
|
let foundWord = null
|
||||||
|
let preid = process.env.INPUT_PREID;
|
||||||
if (messages.some(
|
if (messages.some(
|
||||||
message => /^([a-zA-Z]+)(\(.+\))?(\!)\:/.test(message) || majorWords.some(word => message.includes(word)))) {
|
message => /^([a-zA-Z]+)(\(.+\))?(\!)\:/.test(message) || majorWords.some(word => message.includes(word)))) {
|
||||||
version = 'major'
|
version = 'major'
|
||||||
|
@ -52,14 +52,18 @@ Toolkit.run(async tools => {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
))) {
|
))) {
|
||||||
const preid = process.env.INPUT_PREID || foundWord.split('-')[1]
|
preid = foundWord.split('-')[1]
|
||||||
version = `prerelease --preid=${preid}`
|
version = 'prerelease'
|
||||||
} else if (Array.isArray(patchWords) && patchWords.length) {
|
} else if (Array.isArray(patchWords) && patchWords.length) {
|
||||||
if (!messages.some(message => patchWords.some(word => message.includes(word)))) {
|
if (!messages.some(message => patchWords.some(word => message.includes(word)))) {
|
||||||
version = null
|
version = null
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (version === 'prerelease' && preid) {
|
||||||
|
version = `${version} --preid=${preid}`
|
||||||
|
}
|
||||||
|
|
||||||
if (version === null) {
|
if (version === null) {
|
||||||
tools.exit.success('No version keywords found, skipping bump.')
|
tools.exit.success('No version keywords found, skipping bump.')
|
||||||
return
|
return
|
||||||
|
|
Loading…
Reference in New Issue