| 210 | } |
| 211 | |
| 212 | func 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 | |
| 227 | func getPRComments(repo, prRef string) ([]commentResponse, error) { |
| 228 | cmd := exec.Command("gh", "pr", "view", prRef, "--repo", repo, "--json", "comments") |