Reject invalid boolean input values (#1160)

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: c6daa6b5-31f5-46b2-a994-b8320b50a50d
This commit is contained in:
Bruno Borges
2026-07-28 22:43:39 -04:00
committed by GitHub
parent 382d4b753d
commit ce75feb3d3
4 changed files with 104 additions and 5 deletions
+12 -1
View File
@@ -97365,7 +97365,18 @@ function getTempDir() {
return tempDirectory;
}
function util_getBooleanInput(inputName, defaultValue = false) {
return ((core.getInput(inputName) || String(defaultValue)).toUpperCase() === 'TRUE');
const inputValue = core.getInput(inputName);
const normalizedValue = inputValue.trim().toLowerCase();
if (!normalizedValue) {
return defaultValue;
}
if (normalizedValue === 'true') {
return true;
}
if (normalizedValue === 'false') {
return false;
}
throw new Error(`Invalid value '${inputValue}' for boolean input '${inputName}'. Expected 'true' or 'false'.`);
}
function getVersionFromToolcachePath(toolPath) {
if (toolPath) {
+12 -1
View File
@@ -128364,7 +128364,18 @@ function getTempDir() {
return tempDirectory;
}
function util_getBooleanInput(inputName, defaultValue = false) {
return ((getInput(inputName) || String(defaultValue)).toUpperCase() === 'TRUE');
const inputValue = getInput(inputName);
const normalizedValue = inputValue.trim().toLowerCase();
if (!normalizedValue) {
return defaultValue;
}
if (normalizedValue === 'true') {
return true;
}
if (normalizedValue === 'false') {
return false;
}
throw new Error(`Invalid value '${inputValue}' for boolean input '${inputName}'. Expected 'true' or 'false'.`);
}
function getVersionFromToolcachePath(toolPath) {
if (toolPath) {