in src/helpers/input.ts [114:137]
function getInput(
inputName: string,
allowedValues?: string[],
throwOnMissing = true,
): string | undefined {
const inputValue = core.getInput(inputName)?.trim();
if (!inputValue) {
if (throwOnMissing) {
throw new Error(
`Action input '${inputName}' is required but not provided`,
);
} else {
return;
}
}
if (allowedValues && !allowedValues.includes(inputValue)) {
throw new Error(
`Action input '${inputName}' must be one of the following values: '${allowedValues.join(`', '`)}'`,
);
}
return inputValue;
}