MCPcopy Index your code
hub / github.com/utterance/utterances / postComment

Function postComment

src/github.ts:221–233  ·  view source on GitHub ↗
(issueNumber: number, markdown: string)

Source from the content-addressed store, hash-verified

219}
220
221export function postComment(issueNumber: number, markdown: string) {
222 const url = `repos/${owner}/${repo}/issues/${issueNumber}/comments`;
223 const body = JSON.stringify({ body: markdown });
224 const request = githubRequest(url, { method: 'POST', body });
225 const accept = `${GITHUB_ENCODING__HTML_JSON},${GITHUB_ENCODING__REST_V3}`;
226 request.headers.set('Accept', accept);
227 return githubFetch(request).then<IssueComment>(response => {
228 if (!response.ok) {
229 throw new Error('Error posting comment.');
230 }
231 return response.json();
232 });
233}
234
235export async function toggleReaction(url: string, content: ReactionID) {
236 url = url.replace(GITHUB_API, '');

Callers 1

submitFunction · 0.90

Calls 2

githubRequestFunction · 0.85
githubFetchFunction · 0.85

Tested by

no test coverage detected