@blogic-cz/agent-tools 0.14.22 → 0.14.24
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/gh-tool/pr/core.ts +16 -7
package/package.json
CHANGED
package/src/gh-tool/pr/core.ts
CHANGED
|
@@ -445,9 +445,12 @@ export const createPR = Effect.fn("pr.createPR")(function* (opts: {
|
|
|
445
445
|
|
|
446
446
|
if (Option.isSome(existing)) {
|
|
447
447
|
const pr = existing.value;
|
|
448
|
-
yield*
|
|
449
|
-
|
|
450
|
-
|
|
448
|
+
return yield* editPR({
|
|
449
|
+
pr: pr.number,
|
|
450
|
+
title: opts.title,
|
|
451
|
+
body: opts.body,
|
|
452
|
+
base: null,
|
|
453
|
+
});
|
|
451
454
|
}
|
|
452
455
|
|
|
453
456
|
const createArgs = [
|
|
@@ -647,17 +650,23 @@ export const editPR = Effect.fn("pr.editPR")(function* (opts: {
|
|
|
647
650
|
}
|
|
648
651
|
|
|
649
652
|
const gh = yield* GitHubService;
|
|
653
|
+
const repo = yield* gh.getRepoInfo();
|
|
650
654
|
|
|
651
|
-
const editArgs = [
|
|
655
|
+
const editArgs = [
|
|
656
|
+
"api",
|
|
657
|
+
"--method",
|
|
658
|
+
"PATCH",
|
|
659
|
+
`repos/${repo.owner}/${repo.name}/pulls/${opts.pr}`,
|
|
660
|
+
];
|
|
652
661
|
|
|
653
662
|
if (opts.title) {
|
|
654
|
-
editArgs.push("
|
|
663
|
+
editArgs.push("-f", `title=${opts.title}`);
|
|
655
664
|
}
|
|
656
665
|
if (opts.body) {
|
|
657
|
-
editArgs.push("
|
|
666
|
+
editArgs.push("-f", `body=${opts.body}`);
|
|
658
667
|
}
|
|
659
668
|
if (opts.base) {
|
|
660
|
-
editArgs.push("
|
|
669
|
+
editArgs.push("-f", `base=${opts.base}`);
|
|
661
670
|
}
|
|
662
671
|
|
|
663
672
|
yield* gh.runGh(editArgs);
|