(board, item, note)
| 408 | } |
| 409 | |
| 410 | async function commentGithubIssue(board, item, note) { |
| 411 | const repo = normalizeText(board?.repo || item?.repo); |
| 412 | const issueNumber = extractIssueNumber(item); |
| 413 | const comment = normalizeText(note); |
| 414 | if (!repo || !issueNumber) { |
| 415 | throw new Error("Cannot comment on issue because repo or issue number is missing."); |
| 416 | } |
| 417 | if (!comment) { |
| 418 | return; |
| 419 | } |
| 420 | try { |
| 421 | await runGh(["issue", "comment", issueNumber, "--repo", repo, "--body", comment], activeSession?.workspacePath || process.cwd()); |
| 422 | } catch (error) { |
| 423 | const stderr = normalizeText(error?.stderr || ""); |
| 424 | throw new Error(stderr || `Failed to comment on issue #${issueNumber} in ${repo}.`); |
| 425 | } |
| 426 | } |
| 427 | |
| 428 | function extractIssueNumber(item) { |
| 429 | const explicit = normalizeText(item?.number); |
no test coverage detected