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

Function createIssue

src/github.ts:202–219  ·  view source on GitHub ↗
(issueTerm: string, documentUrl: string, title: string, description: string, label: string)

Source from the content-addressed store, hash-verified

200}
201
202export function createIssue(issueTerm: string, documentUrl: string, title: string, description: string, label: string) {
203 const url = `${UTTERANCES_API}/repos/${owner}/${repo}/issues${label ? `?label=${encodeURIComponent(label)}` : ''}`;
204 const request = new Request(url, {
205 method: 'POST',
206 body: JSON.stringify({
207 title: issueTerm,
208 body: `# ${title}\n\n${description}\n\n[${documentUrl}](${documentUrl})`
209 })
210 });
211 request.headers.set('Accept', GITHUB_ENCODING__REST_V3);
212 request.headers.set('Authorization', `token ${token.value}`);
213 return fetch(request).then<Issue>(response => {
214 if (!response.ok) {
215 throw new Error('Error creating comments container issue');
216 }
217 return response.json();
218 });
219}
220
221export function postComment(issueNumber: number, markdown: string) {
222 const url = `repos/${owner}/${repo}/issues/${issueNumber}/comments`;

Callers 1

submitFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected