Slide 24
Slide 24 text
PullRequestにコメント
const octokit = require("@octokit/rest")();
// This condition prevents infinity loop
if (mag.comment.body.match(/^repeat/i)) {
// Call GitHub api which creates issue comment.
return octokit.issues.createComment({
owner: msg.repository.owner.login,
repo: msg.repository.name,
number: msg.issue.number,
body: `@${msg.sender.login}, You said "${msg.comment.body}"`
});
} else {
return Promise.resolve("The comment was ignored.");
}