mirror of
https://github.com/marocchino/sticky-pull-request-comment.git
synced 2026-04-14 01:56: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
|
|
@ -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) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue