check preReleaseWords
This commit is contained in:
parent
fbcc304011
commit
0f4358dcdd
5
index.js
5
index.js
|
@ -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;
|
||||||
|
|
Loading…
Reference in New Issue