support for preId

This commit is contained in:
gmaggiodev 2020-10-06 17:50:52 +02:00
parent c4c54e048a
commit fcbd2a1268
1 changed files with 16 additions and 2 deletions

View File

@ -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 {