refactor(tools): remove remaining arbitrary workflow caps

This commit is contained in:
morluto
2026-09-29 17:00:06 +08:00
parent 4ad937c6ca
commit ecf3ed8bdb
43 changed files with 230 additions and 393 deletions
@@ -100,7 +100,7 @@ function parseManagedAppManifestMethod(rawMethod, index) {
method.signature_sha256,
`${prefix}.signature_sha256`,
),
il_size: ilSize(method, prefix),
il_size: nonNegativeInteger(method.il_size, `${prefix}.il_size`),
il_sha256:
method.il_sha256 === undefined
? undefined
@@ -112,26 +112,6 @@ function parseManagedAppManifestMethod(rawMethod, index) {
};
}
function ilSize(method, prefix) {
const hasIlSize = method.il_size !== undefined;
const hasIlLength = method.il_length !== undefined;
ensure(
hasIlSize || hasIlLength,
`${prefix}.il_size is required; il_length is accepted as a legacy alias`,
);
if (hasIlSize && hasIlLength)
ensure(
method.il_size === method.il_length,
`${prefix}.il_size and ${prefix}.il_length disagree`,
);
const value = hasIlSize ? method.il_size : method.il_length;
ensure(
Number.isInteger(value) && value >= 0,
`${prefix}.il_size must be a non-negative integer`,
);
return value;
}
function object(value, name) {
ensure(
value !== null && typeof value === "object" && !Array.isArray(value),
@@ -158,6 +138,14 @@ function optionalString(value, name) {
return string(value, name);
}
function nonNegativeInteger(value, name) {
ensure(
Number.isInteger(value) && value >= 0,
`${name} must be a non-negative integer`,
);
return value;
}
function digest(value, name) {
const text = string(value, name);
ensure(/^[a-f0-9]{64}$/u.test(text), `${name} must be a lowercase sha256`);