Merge branch 'master' into replace-option

This commit is contained in:
marocchino 2020-06-25 14:51:01 +09:00 committed by GitHub
commit 8cea69fb3f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 744 additions and 606 deletions

View file

@ -17,19 +17,19 @@ function findPreviousComment(octokit, repo, issue_number, header) {
return __awaiter(this, void 0, void 0, function* () {
const { data: comments } = yield octokit.issues.listComments(Object.assign(Object.assign({}, repo), { issue_number }));
const h = headerComment(header);
return comments.find(comment => comment.body.startsWith(h));
return comments.find(comment => comment.body.includes(h));
});
}
exports.findPreviousComment = findPreviousComment;
function updateComment(octokit, repo, comment_id, body, header, previousBody) {
return __awaiter(this, void 0, void 0, function* () {
yield octokit.issues.updateComment(Object.assign(Object.assign({}, repo), { comment_id, body: previousBody ? `${previousBody}\n${body}` : `${headerComment(header)}\n${body}` }));
yield octokit.issues.updateComment(Object.assign(Object.assign({}, repo), { comment_id, body: previousBody ? `${previousBody}\n${body}` : `${body}\n${headerComment(header)}` }));
});
}
exports.updateComment = updateComment;
function createComment(octokit, repo, issue_number, body, header, previousBody) {
return __awaiter(this, void 0, void 0, function* () {
yield octokit.issues.createComment(Object.assign(Object.assign({}, repo), { issue_number, body: previousBody ? `${previousBody}\n${body}` : `${headerComment(header)}\n${body}` }));
yield octokit.issues.createComment(Object.assign(Object.assign({}, repo), { issue_number, body: previousBody ? `${previousBody}\n${body}` : `${body}\n${headerComment(header)}` }));
});
}
exports.createComment = createComment;