From d7fe1331a1f3bf54f6e9ee1ac8db4ae00ba741ff Mon Sep 17 00:00:00 2001 From: BetaHuhn Date: Mon, 8 Mar 2021 00:13:44 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20Parse=20boolean=20action=20input?= =?UTF-8?q?=20as=20actual=20boolean?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- dist/index.js | 3 ++- src/config.js | 1 + src/index.js | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/dist/index.js b/dist/index.js index 3c262e12..d9208be8 100644 --- a/dist/index.js +++ b/dist/index.js @@ -30175,6 +30175,7 @@ const getVar = ({ key, default: dft, required = false, type = 'string' }) => { if (coreVar !== undefined && coreVar.length >= 1) { if (type === 'array') return coreVar.split('\n') + if (type === 'boolean') return coreVar === 'false' ? false : Boolean(coreVar) return coreVar } @@ -30701,7 +30702,7 @@ const run = async () => { await git.createPrBranch() // Check for existing PR and add warning message that the PR maybe about to change - const existingPr = OVERWRITE_EXISTING_PR && await git.findExistingPr() + const existingPr = OVERWRITE_EXISTING_PR ? await git.findExistingPr() : undefined if (existingPr && DRY_RUN === false) { core.info(`Found existing PR ${ existingPr.number }`) await git.setPrWarning() diff --git a/src/config.js b/src/config.js index b8a68853..78d69fd8 100644 --- a/src/config.js +++ b/src/config.js @@ -15,6 +15,7 @@ const getVar = ({ key, default: dft, required = false, type = 'string' }) => { if (coreVar !== undefined && coreVar.length >= 1) { if (type === 'array') return coreVar.split('\n') + if (type === 'boolean') return coreVar === 'false' ? false : Boolean(coreVar) return coreVar } diff --git a/src/index.js b/src/index.js index 3df3b113..866c3f3a 100644 --- a/src/index.js +++ b/src/index.js @@ -41,7 +41,7 @@ const run = async () => { await git.createPrBranch() // Check for existing PR and add warning message that the PR maybe about to change - const existingPr = OVERWRITE_EXISTING_PR && await git.findExistingPr() + const existingPr = OVERWRITE_EXISTING_PR ? await git.findExistingPr() : undefined if (existingPr && DRY_RUN === false) { core.info(`Found existing PR ${ existingPr.number }`) await git.setPrWarning()