From 1742335df7b8f4fb13c0df4e53f3d932b4650f4f Mon Sep 17 00:00:00 2001 From: Johan LAJILI Date: Tue, 17 Nov 2020 17:24:16 +0000 Subject: [PATCH] Fix not default to patch anymore MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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`). --- index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.js b/index.js index 2ebbdd0..8affc49 100644 --- a/index.js +++ b/index.js @@ -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 }