MCPcopy Create free account
hub / github.com/MiniCodeMonkey/chief / CreatePR

Function CreatePR

internal/git/push.go:39–51  ·  view source on GitHub ↗

CreatePR creates a pull request via `gh pr create` and returns the PR URL.

(dir, branch, title, body string)

Source from the content-addressed store, hash-verified

37
38// CreatePR creates a pull request via `gh pr create` and returns the PR URL.
39func CreatePR(dir, branch, title, body string) (string, error) {
40 cmd := exec.Command("gh", "pr", "create",
41 "--head", branch,
42 "--title", title,
43 "--body", body,
44 )
45 cmd.Dir = dir
46 out, err := cmd.CombinedOutput()
47 if err != nil {
48 return "", fmt.Errorf("failed to create PR: %s", strings.TrimSpace(string(out)))
49 }
50 return strings.TrimSpace(string(out)), nil
51}
52
53// PRTitleFromPRD generates a conventional-commits title for a PR.
54// Format: feat(<prd-name>): <project name>

Callers 2

runAutoCreatePRMethod · 0.92

Calls

no outgoing calls

Tested by

no test coverage detected