MCPcopy Create free account
hub / github.com/ReviewStage/stage-cli / ghWrite

Function ghWrite

packages/cli/src/github/mutations.ts:17–23  ·  view source on GitHub ↗

* Run a `gh` write command in `repoRoot`. Unlike the read adapters in * pull-request.ts (which swallow errors to null), writes surface failures so * the UI can toast them — the user explicitly asked to mutate their PR.

(args: string[], repoRoot: string)

Source from the content-addressed store, hash-verified

15 * the UI can toast them — the user explicitly asked to mutate their PR.
16 */
17async function ghWrite(args: string[], repoRoot: string): Promise<void> {
18 try {
19 await execFileAsync("gh", args, { cwd: repoRoot, encoding: "utf8" });
20 } catch (err: unknown) {
21 throw new Error(ghErrorMessage(err));
22 }
23}
24
25const MERGE_METHOD_FLAG: Record<PullRequestMergeMethod, string> = {
26 [PULL_REQUEST_MERGE_METHOD.MERGE]: "--merge",

Callers 8

editTitleFunction · 0.85
closePullRequestFunction · 0.85
reopenPullRequestFunction · 0.85
setDraftFunction · 0.85
mergePullRequestFunction · 0.85
setAutoMergeFunction · 0.85
addReviewersFunction · 0.85
removeReviewersFunction · 0.85

Calls 1

ghErrorMessageFunction · 0.85

Tested by

no test coverage detected