mirror of
https://github.com/openclaw/openclaw.git
synced 2026-08-28 05:16:23 -06:00
fix(ci): reject hosted gate flag values
This commit is contained in:
@@ -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", () => {
|
||||
|
||||
Reference in New Issue
Block a user