Skip to content

Commit

Permalink
🐛 Parse boolean action input as actual boolean
Browse files Browse the repository at this point in the history
  • Loading branch information
BetaHuhn committed Mar 8, 2021
1 parent 45b0074 commit d7fe133
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down Expand Up @@ -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()
Expand Down
1 change: 1 addition & 0 deletions src/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
2 changes: 1 addition & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit d7fe133

Please sign in to comment.