diff --git a/dist/post_run/index.js b/dist/post_run/index.js index 06050ea1f0..6f07a5f73c 100644 --- a/dist/post_run/index.js +++ b/dist/post_run/index.js @@ -88844,7 +88844,7 @@ async function buildCacheKeys() { return keys; } async function restoreCache() { - if (core.getInput(`skip-cache`, { required: true }).trim() == "true") + if (core.getBooleanInput(`skip-cache`, { required: true })) return; if (!utils.isValidEvent()) { utils.logWarning(`Event Validation Error: The event type ${process.env[constants_1.Events.Key]} is not supported because it's not tied to a branch or tag ref.`); @@ -88882,9 +88882,9 @@ async function restoreCache() { } exports.restoreCache = restoreCache; async function saveCache() { - if (core.getInput(`skip-cache`, { required: true }).trim() == "true") + if (core.getBooleanInput(`skip-cache`, { required: true })) return; - if (core.getInput(`skip-save-cache`, { required: true }).trim() == "true") + if (core.getBooleanInput(`skip-save-cache`, { required: true })) return; // Validate inputs, this can cause task failure if (!utils.isValidEvent()) { @@ -89150,11 +89150,7 @@ const execShellCommand = (0, util_1.promisify)(child_process_1.exec); const writeFile = (0, util_1.promisify)(fs.writeFile); const createTempDir = (0, util_1.promisify)(tmp_1.dir); function isOnlyNewIssues() { - const onlyNewIssues = core.getInput(`only-new-issues`, { required: true }).trim(); - if (onlyNewIssues !== `false` && onlyNewIssues !== `true`) { - throw new Error(`invalid value of "only-new-issues": "${onlyNewIssues}", expected "true" or "false"`); - } - return onlyNewIssues === `true`; + return core.getBooleanInput(`only-new-issues`, { required: true }); } async function prepareLint() { const mode = core.getInput("install-mode").toLowerCase(); @@ -89289,7 +89285,7 @@ async function runLint(lintPath, patchPath) { .map(([key, value]) => [key.toLowerCase(), value ?? ""]); const userArgsMap = new Map(userArgsList); const userArgNames = new Set(userArgsList.map(([key]) => key)); - const annotations = core.getInput(`annotations`).trim() !== "false"; + const annotations = core.getBooleanInput(`annotations`); if (annotations) { const formats = (userArgsMap.get("out-format") || "") .trim() diff --git a/dist/run/index.js b/dist/run/index.js index b361fc4f25..b67b479635 100644 --- a/dist/run/index.js +++ b/dist/run/index.js @@ -88844,7 +88844,7 @@ async function buildCacheKeys() { return keys; } async function restoreCache() { - if (core.getInput(`skip-cache`, { required: true }).trim() == "true") + if (core.getBooleanInput(`skip-cache`, { required: true })) return; if (!utils.isValidEvent()) { utils.logWarning(`Event Validation Error: The event type ${process.env[constants_1.Events.Key]} is not supported because it's not tied to a branch or tag ref.`); @@ -88882,9 +88882,9 @@ async function restoreCache() { } exports.restoreCache = restoreCache; async function saveCache() { - if (core.getInput(`skip-cache`, { required: true }).trim() == "true") + if (core.getBooleanInput(`skip-cache`, { required: true })) return; - if (core.getInput(`skip-save-cache`, { required: true }).trim() == "true") + if (core.getBooleanInput(`skip-save-cache`, { required: true })) return; // Validate inputs, this can cause task failure if (!utils.isValidEvent()) { @@ -89150,11 +89150,7 @@ const execShellCommand = (0, util_1.promisify)(child_process_1.exec); const writeFile = (0, util_1.promisify)(fs.writeFile); const createTempDir = (0, util_1.promisify)(tmp_1.dir); function isOnlyNewIssues() { - const onlyNewIssues = core.getInput(`only-new-issues`, { required: true }).trim(); - if (onlyNewIssues !== `false` && onlyNewIssues !== `true`) { - throw new Error(`invalid value of "only-new-issues": "${onlyNewIssues}", expected "true" or "false"`); - } - return onlyNewIssues === `true`; + return core.getBooleanInput(`only-new-issues`, { required: true }); } async function prepareLint() { const mode = core.getInput("install-mode").toLowerCase(); @@ -89289,7 +89285,7 @@ async function runLint(lintPath, patchPath) { .map(([key, value]) => [key.toLowerCase(), value ?? ""]); const userArgsMap = new Map(userArgsList); const userArgNames = new Set(userArgsList.map(([key]) => key)); - const annotations = core.getInput(`annotations`).trim() !== "false"; + const annotations = core.getBooleanInput(`annotations`); if (annotations) { const formats = (userArgsMap.get("out-format") || "") .trim() diff --git a/src/cache.ts b/src/cache.ts index 75fda9f9a4..314647d6a7 100644 --- a/src/cache.ts +++ b/src/cache.ts @@ -65,7 +65,7 @@ async function buildCacheKeys(): Promise { } export async function restoreCache(): Promise { - if (core.getInput(`skip-cache`, { required: true }).trim() == "true") return + if (core.getBooleanInput(`skip-cache`, { required: true })) return if (!utils.isValidEvent()) { utils.logWarning( @@ -107,8 +107,8 @@ export async function restoreCache(): Promise { } export async function saveCache(): Promise { - if (core.getInput(`skip-cache`, { required: true }).trim() == "true") return - if (core.getInput(`skip-save-cache`, { required: true }).trim() == "true") return + if (core.getBooleanInput(`skip-cache`, { required: true })) return + if (core.getBooleanInput(`skip-save-cache`, { required: true })) return // Validate inputs, this can cause task failure if (!utils.isValidEvent()) { diff --git a/src/run.ts b/src/run.ts index 2d5d3a2ae2..48550d4576 100644 --- a/src/run.ts +++ b/src/run.ts @@ -17,13 +17,7 @@ const writeFile = promisify(fs.writeFile) const createTempDir = promisify(dir) function isOnlyNewIssues(): boolean { - const onlyNewIssues = core.getInput(`only-new-issues`, { required: true }).trim() - - if (onlyNewIssues !== `false` && onlyNewIssues !== `true`) { - throw new Error(`invalid value of "only-new-issues": "${onlyNewIssues}", expected "true" or "false"`) - } - - return onlyNewIssues === `true` + return core.getBooleanInput(`only-new-issues`, { required: true }) } async function prepareLint(): Promise { @@ -191,7 +185,7 @@ async function runLint(lintPath: string, patchPath: string): Promise { const userArgsMap = new Map(userArgsList) const userArgNames = new Set(userArgsList.map(([key]) => key)) - const annotations = core.getInput(`annotations`).trim() !== "false" + const annotations = core.getBooleanInput(`annotations`) if (annotations) { const formats = (userArgsMap.get("out-format") || "")