Attempt to fix prerelease

This commit is contained in:
mariosch 2021-07-01 13:08:46 +03:00
parent 22d657a2ad
commit d51ed3a368
1 changed files with 5 additions and 1 deletions

View File

@ -36,6 +36,8 @@ Toolkit.run(async (tools) => {
let version = process.env.INPUT_DEFAULT; let version = process.env.INPUT_DEFAULT;
let foundWord = null; let foundWord = null;
let preid = process.env.INPUT_PREID; let preid = process.env.INPUT_PREID;
tools.log('Version is set to Begining: ' + version);
if ( if (
messages.some( 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)),
@ -62,7 +64,9 @@ Toolkit.run(async (tools) => {
version = 'prerelease'; version = 'prerelease';
tools.log('Version is set to prerelease2'); tools.log('Version is set to prerelease2');
} else if (Array.isArray(patchWords) && patchWords.length) { } else if (Array.isArray(patchWords) && patchWords.length) {
tools.log('PatchWords is set : ' + patchWords);
if (!messages.some((message) => patchWords.some((word) => message.includes(word)))) { if (!messages.some((message) => patchWords.some((word) => message.includes(word)))) {
tools.log('Messages found on the patchwords : ' + messages);
version = null; version = null;
tools.log('Version is set to null 2'); tools.log('Version is set to null 2');
} }
@ -82,7 +86,7 @@ Toolkit.run(async (tools) => {
version = null; version = null;
} }
if (version === 'prerelease' && preid) { if (version === 'prerelease' || process.env.INPUT_DEFAULT === 'prerelease' && preid) {
tools.log('Version is prerelease and it contains a preid'); tools.log('Version is prerelease and it contains a preid');
version = `${version} --preid=${preid}`; version = `${version} --preid=${preid}`;
} }