check preReleaseWords

This commit is contained in:
Phil 2021-11-22 13:54:01 +01:00 committed by GitHub
parent fbcc304011
commit 0f4358dcdd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 2 deletions

View File

@ -38,7 +38,7 @@ const workspace = process.env.GITHUB_WORKSPACE;
const minorWords = process.env['INPUT_MINOR-WORDING'].split(','); const minorWords = process.env['INPUT_MINOR-WORDING'].split(',');
// patch is by default empty, and '' would always be true in the includes(''), thats why we handle it separately // patch is by default empty, and '' would always be true in the includes(''), thats why we handle it separately
const patchWords = process.env['INPUT_PATCH-WORDING'] ? process.env['INPUT_PATCH-WORDING'].split(',') : null; const patchWords = process.env['INPUT_PATCH-WORDING'] ? process.env['INPUT_PATCH-WORDING'].split(',') : null;
const preReleaseWords = process.env['INPUT_RC-WORDING'] ? process.env['INPUT_RC-WORDING'].split(',') : []; const preReleaseWords = process.env['INPUT_RC-WORDING'] ? process.env['INPUT_RC-WORDING'].split(',') : null;
console.log('config words:', { majorWords, minorWords, patchWords, preReleaseWords }); console.log('config words:', { majorWords, minorWords, patchWords, preReleaseWords });
@ -66,6 +66,7 @@ const workspace = process.env.GITHUB_WORKSPACE;
} }
// case: if wording for PRE-RELEASE found // case: if wording for PRE-RELEASE found
else if ( else if (
preReleaseWords &&
messages.some((message) => messages.some((message) =>
preReleaseWords.some((word) => { preReleaseWords.some((word) => {
if (message.includes(word)) { if (message.includes(word)) {
@ -89,7 +90,7 @@ const workspace = process.env.GITHUB_WORKSPACE;
// then unset it and do not run // then unset it and do not run
if ( if (
version === 'prerelease' && version === 'prerelease' &&
preReleaseWords !== '' && preReleaseWords &&
!messages.some((message) => preReleaseWords.some((word) => message.includes(word))) !messages.some((message) => preReleaseWords.some((word) => message.includes(word)))
) { ) {
version = null; version = null;