MCPcopy Create free account
hub / github.com/github/awesome-copilot / commentGithubIssue

Function commentGithubIssue

extensions/backlog-swipe-triage/extension.mjs:410–426  ·  view source on GitHub ↗
(board, item, note)

Source from the content-addressed store, hash-verified

408}
409
410async 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
428function extractIssueNumber(item) {
429 const explicit = normalizeText(item?.number);

Callers 2

handleServerRequestFunction · 0.85
extension.mjsFile · 0.85

Calls 3

extractIssueNumberFunction · 0.85
runGhFunction · 0.85
normalizeTextFunction · 0.70

Tested by

no test coverage detected