Skip to content

Commit bda05db

Browse files
committed
fix(release): reject validation flag values
1 parent 7069d95 commit bda05db

2 files changed

Lines changed: 4 additions & 1 deletion

File tree

scripts/full-release-validation-at-sha.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ function runStatus(command, args, options = {}) {
4444

4545
function readOptionValue(argv, index, optionName) {
4646
const value = argv[index + 1];
47-
if (value === undefined || value === "" || value.startsWith("--")) {
47+
if (value === undefined || value === "" || value.startsWith("-")) {
4848
throw new Error(`${optionName} requires a value`);
4949
}
5050
return value;

test/scripts/full-release-validation-at-sha.test.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,10 @@ describe("full-release-validation-at-sha", () => {
3030

3131
it("rejects missing option values", () => {
3232
expect(() => parseArgs(["--sha", "--dry-run"])).toThrow("--sha requires a value");
33+
expect(() => parseArgs(["--sha", "-h"])).toThrow("--sha requires a value");
3334
expect(() => parseArgs(["--branch"])).toThrow("--branch requires a value");
35+
expect(() => parseArgs(["--branch", "-h"])).toThrow("--branch requires a value");
3436
expect(() => parseArgs(["-f", "--dry-run"])).toThrow("-f requires a value");
37+
expect(() => parseArgs(["-f", "-h"])).toThrow("-f requires a value");
3538
});
3639
});

0 commit comments

Comments
 (0)