(issueNumber: number, markdown: string)
| 219 | } |
| 220 | |
| 221 | export 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 | |
| 235 | export async function toggleReaction(url: string, content: ReactionID) { |
| 236 | url = url.replace(GITHUB_API, ''); |
no test coverage detected