diff --git a/src/comment.ts b/src/comment.ts index 78504db..7497acc 100644 --- a/src/comment.ts +++ b/src/comment.ts @@ -1,21 +1,23 @@ +const HEADER = ""; + export async function findPreviousComment(octokit, repo, issue_number) { const { data: comments } = await octokit.issues.listComments({ ...repo, issue_number }); - return comments.find(comment => comment.user.login === "github-actions[bot]"); + return comments.find(comment => comment.body.startsWith(HEADER)); } export async function updateComment(octokit, repo, comment_id, body) { await octokit.issues.updateComment({ ...repo, comment_id, - body + body: `${HEADER}\n${body}` }); } export async function createComment(octokit, repo, issue_number, body) { await octokit.issues.createComment({ ...repo, issue_number, - body + body: `${HEADER}\n${body}` }); }