fix(ci): reject hosted gate flag values

This commit is contained in:
Vincent Koc
2026-06-21 20:09:53 +02:00
parent bda05dbc2f
commit 03ce3d41b1
2 changed files with 17 additions and 1 deletions
+1 -1
View File
@@ -20,7 +20,7 @@ const ARTIFACT_FALLBACK_REQUIRED_WORKFLOWS = [
function readOptionValue(argv, index, optionName) {
const value = argv[index + 1];
if (!value || value.startsWith("--")) {
if (!value || value.startsWith("-")) {
throw new Error(`Expected ${optionName} <value>.`);
}
return value;
@@ -304,6 +304,22 @@ describe("verify-pr-hosted-gates", () => {
changelogOnly: false,
});
expect(() => parseArgs(["--repo", "openclaw/openclaw"])).toThrow("Usage:");
expect(() =>
parseArgs(["--repo", "-h", "--sha", sha, "--output", ".local/gates-hosted-checks.json"]),
).toThrow("Expected --repo <value>.");
expect(() =>
parseArgs([
"--repo",
"openclaw/openclaw",
"--sha",
"-h",
"--output",
".local/gates-hosted-checks.json",
]),
).toThrow("Expected --sha <value>.");
expect(() =>
parseArgs(["--repo", "openclaw/openclaw", "--sha", sha, "--output", "-h"]),
).toThrow("Expected --output <value>.");
});
it("accepts JSON emitted through a colorizing GitHub CLI shim", () => {