fix(ci): reject partially parsed concurrency limits
Number.parseInt accepts a numeric prefix, so values like 1.5 or 8junk silently ran an unintended worker count. Require the full string to round-trip (same pattern as run-gates' positiveIntArg).
This commit is contained in:
@@ -33,7 +33,7 @@ function probeConcurrency(total) {
|
||||
const raw = process.env[CONCURRENCY_ENV]
|
||||
if (raw !== undefined && raw !== '') {
|
||||
const parsed = Number.parseInt(raw, 10)
|
||||
if (!Number.isSafeInteger(parsed) || parsed < 1) {
|
||||
if (!Number.isSafeInteger(parsed) || parsed < 1 || String(parsed) !== raw) {
|
||||
throw new Error(`verify-built-package-invariants: ${CONCURRENCY_ENV} must be a positive integer, got ${JSON.stringify(raw)}.`)
|
||||
}
|
||||
return Math.min(total, parsed)
|
||||
|
||||
Reference in New Issue
Block a user