MCPcopy Index your code
hub / github.com/nikivdev/go / getPRInfo

Function getPRInfo

cli/github/main.go:212–225  ·  view source on GitHub ↗
(repo, prRef string)

Source from the content-addressed store, hash-verified

210}
211
212func getPRInfo(repo, prRef string) (*prInfoResponse, error) {
213 cmd := exec.Command("gh", "pr", "view", prRef, "--repo", repo, "--json",
214 "title,body,author,state,baseRefName,headRefName,additions,deletions,changedFiles")
215 output, err := cmd.Output()
216 if err != nil {
217 return nil, fmt.Errorf("gh pr view: %w", err)
218 }
219
220 var info prInfoResponse
221 if err := json.Unmarshal(output, &info); err != nil {
222 return nil, fmt.Errorf("parse PR info: %w", err)
223 }
224 return &info, nil
225}
226
227func getPRComments(repo, prRef string) ([]commentResponse, error) {
228 cmd := exec.Command("gh", "pr", "view", prRef, "--repo", repo, "--json", "comments")

Callers 1

runDiffDirectFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected