* Add progress comment for Stable and LTS cherry-picks * @return {Promise }
()
| 30 | * @return {Promise<void>} |
| 31 | */ |
| 32 | async 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 | |
| 53 | addComment(); |
no test coverage detected