MCPcopy
hub / github.com/ampproject/amphtml / addComment

Function addComment

build-system/status-page/comment.js:32–51  ·  view source on GitHub ↗

* Add progress comment for Stable and LTS cherry-picks * @return {Promise }

()

Source from the content-addressed store, hash-verified

30 * @return {Promise<void>}
31 */
32async function addComment() {
33 const channels = getChannels(body);
34 if (channels.length == 0) {
35 return;
36 }
37
38 const apiUrl = `https://api.github.com/repos/ampproject/amphtml/issues/${number}/comments`;
39 const headers = {
40 Authorization: `token ${process.env.GITHUB_TOKEN}`,
41 Accept: 'application/vnd.github.v3+json',
42 };
43 const options = {
44 method: 'POST',
45 headers,
46 body: JSON.stringify({body: commentTemplate(channels)}),
47 };
48
49 const response = await fetch(apiUrl, options);
50 log(await response.json());
51}
52
53addComment();

Callers 1

comment.jsFile · 0.85

Calls 6

getChannelsFunction · 0.85
commentTemplateFunction · 0.85
fetchFunction · 0.85
stringifyMethod · 0.80
logFunction · 0.50
jsonMethod · 0.45

Tested by

no test coverage detected