Skip to content

Commit d7fe133

Browse files
committed
🐛 Parse boolean action input as actual boolean
1 parent 45b0074 commit d7fe133

File tree

3 files changed

+4
-2
lines changed

3 files changed

+4
-2
lines changed

dist/index.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -30175,6 +30175,7 @@ const getVar = ({ key, default: dft, required = false, type = 'string' }) => {
3017530175

3017630176
if (coreVar !== undefined && coreVar.length >= 1) {
3017730177
if (type === 'array') return coreVar.split('\n')
30178+
if (type === 'boolean') return coreVar === 'false' ? false : Boolean(coreVar)
3017830179

3017930180
return coreVar
3018030181
}
@@ -30701,7 +30702,7 @@ const run = async () => {
3070130702
await git.createPrBranch()
3070230703

3070330704
// Check for existing PR and add warning message that the PR maybe about to change
30704-
const existingPr = OVERWRITE_EXISTING_PR && await git.findExistingPr()
30705+
const existingPr = OVERWRITE_EXISTING_PR ? await git.findExistingPr() : undefined
3070530706
if (existingPr && DRY_RUN === false) {
3070630707
core.info(`Found existing PR ${ existingPr.number }`)
3070730708
await git.setPrWarning()

src/config.js

+1
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ const getVar = ({ key, default: dft, required = false, type = 'string' }) => {
1515

1616
if (coreVar !== undefined && coreVar.length >= 1) {
1717
if (type === 'array') return coreVar.split('\n')
18+
if (type === 'boolean') return coreVar === 'false' ? false : Boolean(coreVar)
1819

1920
return coreVar
2021
}

src/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ const run = async () => {
4141
await git.createPrBranch()
4242

4343
// Check for existing PR and add warning message that the PR maybe about to change
44-
const existingPr = OVERWRITE_EXISTING_PR && await git.findExistingPr()
44+
const existingPr = OVERWRITE_EXISTING_PR ? await git.findExistingPr() : undefined
4545
if (existingPr && DRY_RUN === false) {
4646
core.info(`Found existing PR ${ existingPr.number }`)
4747
await git.setPrWarning()

0 commit comments

Comments
 (0)