diff --git a/scripts/verify-docker-attestations.mjs b/scripts/verify-docker-attestations.mjs index a3cc976aa46..e0aa245b671 100644 --- a/scripts/verify-docker-attestations.mjs +++ b/scripts/verify-docker-attestations.mjs @@ -134,7 +134,7 @@ function inspectRaw(imageRef) { function readOptionValue(argv, index, optionName) { const value = argv[index + 1]; - if (value === undefined || value === "" || value.startsWith("--")) { + if (value === undefined || value === "" || value.startsWith("-")) { throw new Error(`${optionName} requires a value`); } return value; diff --git a/test/scripts/verify-docker-attestations.test.ts b/test/scripts/verify-docker-attestations.test.ts index 6fe68adb883..1a829975a9e 100644 --- a/test/scripts/verify-docker-attestations.test.ts +++ b/test/scripts/verify-docker-attestations.test.ts @@ -69,6 +69,7 @@ describe("verify-docker-attestations", () => { it("rejects missing platform option values", () => { expect(() => parseArgs(["--platform"])).toThrow("--platform requires a value"); + expect(() => parseArgs(["--platform", "-h"])).toThrow("--platform requires a value"); expect(() => parseArgs(["--platform", "--help"])).toThrow("--platform requires a value"); expect(() => parseArgs(["--platform", ""])).toThrow("--platform requires a value"); });