Fix not default to patch anymore

Hi, I'm using the last version of this github action and it doesn't resolve to patch anymore, it says
```
Couldn't find any commits in this event, incrementing patch version...
messages: []
✔  success   No version keywords found, skipping bump.
```
I believe this is because patchWords is an empty array, which then makes it enter the condition line 54, and since it's written negatively version will be set to null.

I don't really understand why patchWords is an empty array, but I'm guessing `process.env['INPUT_PATCH-WORDING']` results in an empty string. (if that wasn't the case it would crash line 31 saying `cannot read property split of undefined`).
This commit is contained in:
Johan LAJILI 2020-11-17 17:24:16 +00:00 committed by GitHub
parent c8d9213c26
commit 1742335df7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -50,7 +50,7 @@ Toolkit.run(async tools => {
))) {
const preid = foundWord.split('-')[1]
version = `prerelease --preid=${preid}`
} else if (patchWords && Array.isArray(patchWords)) {
} else if (patchWords && Array.isArray(patchWords) && patchWords.length) {
if (!messages.some(message => patchWords.some(word => message.includes(word)))) {
version = null
}