Attempt to fix prerelease

This commit is contained in:
mariosch 2021-07-01 12:50:22 +03:00
parent 9550a43c09
commit d2aab699b5
1 changed files with 7 additions and 2 deletions

View File

@ -44,8 +44,10 @@ Toolkit.run(async (tools) => {
) )
) { ) {
version = 'major'; version = 'major';
tools.log('Version is set to 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';
tools.log('Version is set to minor');
} else if ( } else if (
messages.some((message) => messages.some((message) =>
preReleaseWords.some((word) => { preReleaseWords.some((word) => {
@ -60,19 +62,22 @@ Toolkit.run(async (tools) => {
) { ) {
preid = foundWord.split('-')[1]; preid = foundWord.split('-')[1];
version = 'prerelease'; version = 'prerelease';
tools.log('Version is set to prerelease2');
} 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;
tools.log('Version is set to null 2');
} }
} else if (process.env.INPUT_DEFAULT === 'prerelease'){ } else if (process.env.INPUT_DEFAULT === 'prerelease'){
tools.log('Version is set to prerelease');
version = 'prerelease'; version = 'prerelease';
} }
// case: if default=prerelease, but rc-wording is also set // case: if default=prerelease, but rc-wording is also set
// then unset it and do not run, when no rc words found in message // then unset it and do not run, when no rc words found in message
tools.log('Before Login'); tools.log('Before Login');
tools.log(version); tools.log(version); // null
tools.log('PreID: ' + preid); tools.log('PreID: ' + preid); //prc
tools.log(process.env.INPUT_DEFAULT); tools.log(process.env.INPUT_DEFAULT);
if (version === 'prerelease' && !messages.some((message) => preReleaseWords.some((word) => message.includes(word))) && process.env.INPUT_DEFAULT != 'prerelease') { if (version === 'prerelease' && !messages.some((message) => preReleaseWords.some((word) => message.includes(word))) && process.env.INPUT_DEFAULT != 'prerelease') {
tools.log('Version is set to null'); tools.log('Version is set to null');