mirror of
https://github.com/pnpm/action-setup.git
synced 2025-04-04 17:59:35 +08:00
fix: another edge case for input.args
This commit is contained in:
parent
3dac3a52e2
commit
7302d3bf3c
|
@ -52,16 +52,18 @@ function isEntryValid(input: any): boolean {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (input.args !== undefined && !Array.isArray(input.args)) {
|
if (input.args !== undefined) {
|
||||||
error(`Invalid input for run_install.args. Expected array, but got ${typeof input.args}`)
|
if (!Array.isArray(input.args)) {
|
||||||
return false;
|
error(`Invalid input for run_install.args. Expected array, but got ${typeof input.args}`)
|
||||||
}
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
const invalidArgs: any[] = input.args.filter((arg: any) => typeof arg !== 'string');
|
const invalidArgs: any[] = input.args.filter((arg: any) => typeof arg !== 'string');
|
||||||
if (input.args !== undefined && invalidArgs.length > 0) {
|
if (invalidArgs.length > 0) {
|
||||||
const invalidArgsMessage = invalidArgs.map((arg: any) => typeof arg).join(', ');
|
const invalidArgsMessage = invalidArgs.map((arg: any) => typeof arg).join(', ');
|
||||||
error(`Invalid input for run_install.args. Expected array of strings, but got ${invalidArgsMessage}`)
|
error(`Invalid input for run_install.args. Expected array of strings, but got ${invalidArgsMessage}`)
|
||||||
return false;
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user