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()