support for preId
This commit is contained in:
parent
c4c54e048a
commit
fcbd2a1268
18
index.js
18
index.js
|
@ -28,14 +28,28 @@ Toolkit.run(async tools => {
|
||||||
|
|
||||||
const majorWords = process.env['INPUT_MAJOR-WORDING'].split(',')
|
const majorWords = process.env['INPUT_MAJOR-WORDING'].split(',')
|
||||||
const minorWords = process.env['INPUT_MINOR-WORDING'].split(',')
|
const minorWords = process.env['INPUT_MINOR-WORDING'].split(',')
|
||||||
|
const prereleaseWords = ['preprelease', 'alpha', 'beta', 'rc']
|
||||||
|
|
||||||
let version = 'patch'
|
let version = 'patch'
|
||||||
|
let preid = null;
|
||||||
|
let foundWords = [];
|
||||||
|
|
||||||
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'
|
||||||
} else if (messages.some(message => minorWords.some(word => message.includes(word)))) {
|
} else if (messages.some(message => minorWords.some(word => message.includes(word)))) {
|
||||||
version = 'minor'
|
version = 'minor'
|
||||||
} else if (messages.some(message => message.includes('prerelease'))) {
|
} else if (messages.some(message => prereleaseWords.some(word => {
|
||||||
version = 'prerelease'
|
if (message.includes(word)) {
|
||||||
|
foundWords.push(word);
|
||||||
|
return true;
|
||||||
|
} else {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
))) {
|
||||||
|
version = 'prerelease';
|
||||||
|
console.log(foundWords);
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
|
Loading…
Reference in New Issue