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

@ -8,20 +8,20 @@ export async function findPreviousComment(octokit, repo, issue_number, header) {
issue_number
});
const h = headerComment(header);
return comments.find(comment => comment.body.startsWith(h));
return comments.find(comment => comment.body.includes(h));
}
export async function updateComment(octokit, repo, comment_id, body, header, previousBody?) {
await octokit.issues.updateComment({
...repo,
comment_id,
body: previousBody ? `${previousBody}\n${body}` : `${headerComment(header)}\n${body}`
body: previousBody ? `${previousBody}\n${body}` : `${body}\n${headerComment(header)}`
});
}
export async function createComment(octokit, repo, issue_number, body, header, previousBody?) {
await octokit.issues.createComment({
...repo,
issue_number,
body: previousBody ? `${previousBody}\n${body}` : `${headerComment(header)}\n${body}`
body: previousBody ? `${previousBody}\n${body}` : `${body}\n${headerComment(header)}`
});
}
export async function deleteComment(octokit, repo, comment_id) {