Skip to content

The fastest, cheapest, most efficient open-source agent harness. Run more than 500 agents on a $10 VPS.

test(scripts): update argument parsing for release and repin scripts

Steven Enamakel8d94c40dcc95
diff --git a/scripts/__tests__/module-release-and-repin.test.mjs b/scripts/__tests__/module-release-and-repin.test.mjs
index 89f26f4b2b..83e50fbd2c 100644
--- a/scripts/__tests__/module-release-and-repin.test.mjs
+++ b/scripts/__tests__/module-release-and-repin.test.mjs
@@ -122,7 +122,14 @@ test("bumpVersion and parseArgs", () => {
assert.equal(bumpVersion("0.2.9", "minor"), "0.3.0");
assert.equal(bumpVersion("0.2.9", "major"), "1.0.0");
assert.throws(() => bumpVersion("0.2.9", "huge"), /--bump/);
- assert.deepEqual(parseArgs(["tinyx", "--bump", "minor", "--yes"]), { bump: "minor", yes: true, dryRun: false, id: "tinyx" });
+ assert.deepEqual(parseArgs(["tinyx", "--bump", "minor", "--yes"]), {
+ bump: "minor",
+ yes: true,
+ dryRun: false,
+ owner: "tinyhumansai",
+ workflowInput: "bump",
+ id: "tinyx",
+ });
assert.throws(() => parseArgs([]), /usage/);
assert.throws(() => parseArgs(["x", "--bump", "no"]), /--bump/);
});
diff --git a/scripts/modules/release-and-repin.mjs b/scripts/modules/release-and-repin.mjs
index 5310f3bd92..a07c2024b1 100644
--- a/scripts/modules/release-and-repin.mjs
+++ b/scripts/modules/release-and-repin.mjs
@@ -136,6 +136,11 @@ async function defaultConfirm(question) {
* injectable so tests never touch GitHub or git.
*/
export async function repin(opts, deps = {}) {
+ opts = {
+ ...opts,
+ owner: opts.owner ?? ORG,
+ workflowInput: opts.workflowInput ?? "bump",
+ };
const root = resolve(opts.root ?? DEFAULT_ROOT);
const run = deps.run ?? defaultRun;
const confirm = deps.confirm ?? defaultConfirm;