fix(workflow): prevent prototype traversal and inherited CLI authorization

This commit is contained in:
gitea committed 2026-10-20 17:52:14 +08:00
1 parent fac81b08e8
commit d2e0d564ca
6 files changed
+62 -31

No files matched your search

+2 -2
View File
@@ -25,12 +25,12 @@ export class MutationConfirmationRequired extends CliError {
}
export function isDryRun(parsed: CliParsedArgs, runtime: CliRuntime): boolean {
return runtime.dryRun === true || booleanOption(parsed.options, ["dry-run", "dryRun", "dryrun"]);
return (Object.hasOwn(runtime, "dryRun") && runtime.dryRun === true) || booleanOption(parsed.options, ["dry-run", "dryRun", "dryrun"]);
}
export function isConfirmed(parsed: CliParsedArgs, runtime: CliRuntime): boolean {
return (
runtime.confirmed === true ||
(Object.hasOwn(runtime, "confirmed") && runtime.confirmed === true) ||
booleanOption(parsed.options, ["yes", "y", "confirm", "force-write"])
);
}