From 81f6eb258ef407d15d458c650a2f2b45a512c6a3 Mon Sep 17 00:00:00 2001 From: Mike Barry Date: Tue, 22 Dec 2020 20:34:14 -0500 Subject: [PATCH] fix boolean handling --- lib/main.js | 6 +++--- src/main.ts | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/main.js b/lib/main.js index b022235c..da00403a 100644 --- a/lib/main.js +++ b/lib/main.js @@ -46,9 +46,9 @@ function run() { const message = core.getInput("message", { required: false }); const path = core.getInput("path", { required: false }); const header = core.getInput("header", { required: false }) || ""; - const append = core.getInput("append", { required: false }) || false; - const recreate = core.getInput("recreate", { required: false }) || false; - const deleteOldComment = core.getInput("delete", { required: false }) || false; + const append = (core.getInput("append", { required: false }) || "false") === "true"; + const recreate = (core.getInput("recreate", { required: false }) || "false") === "true"; + const deleteOldComment = (core.getInput("delete", { required: false }) || "false") === "true"; const githubToken = core.getInput("GITHUB_TOKEN", { required: true }); const octokit = new github_1.GitHub(githubToken); const previous = yield comment_1.findPreviousComment(octokit, repo, number, header); diff --git a/src/main.ts b/src/main.ts index 7915d690..73c7cd9b 100644 --- a/src/main.ts +++ b/src/main.ts @@ -17,9 +17,9 @@ async function run() { const message = core.getInput("message", { required: false }); const path = core.getInput("path", { required: false }); const header = core.getInput("header", { required: false }) || ""; - const append = core.getInput("append", { required: false }) || false; - const recreate = core.getInput("recreate", { required: false }) || false; - const deleteOldComment = core.getInput("delete", { required: false }) || false; + const append = (core.getInput("append", { required: false }) || "false") === "true"; + const recreate = (core.getInput("recreate", { required: false }) || "false") === "true"; + const deleteOldComment = (core.getInput("delete", { required: false }) || "false") === "true"; const githubToken = core.getInput("GITHUB_TOKEN", { required: true }); const octokit = new GitHub(githubToken); const previous = await findPreviousComment(octokit, repo, number, header);