| 355 | const prNumber = options.prNumber || options.pr; |
| 356 | if (!repo || !prNumber) throw new Error('buildGitHubReviewFetchCommands requires repo and prNumber'); |
| 357 | return [ |
| 358 | ['gh', ['api', `repos/${repo}/issues/${prNumber}/comments`, '--paginate']], |
| 359 | ['gh', ['api', `repos/${repo}/pulls/${prNumber}/comments`, '--paginate']], |
| 360 | ['gh', ['api', `repos/${repo}/pulls/${prNumber}/reviews`, '--paginate']], |
| 361 | ]; |
| 362 | } |
| 363 | |
| 364 | function normalizeReviewItems(raw) { |
| 365 | if (!raw) return []; |
| 366 | if (Array.isArray(raw)) return raw; |
| 367 | if (Array.isArray(raw.comments)) return raw.comments; |