mirror of
https://github.com/marocchino/sticky-pull-request-comment.git
synced 2026-04-14 18:16:52 +00:00
Merge branch 'master' into replace-option
This commit is contained in:
commit
8cea69fb3f
5 changed files with 744 additions and 606 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue