From 28b1532b8acbd8dd659f30cbbfc89aad79f2a407 Mon Sep 17 00:00:00 2001 From: James Warwood Date: Mon, 1 Jul 2024 09:03:01 +0100 Subject: [PATCH] fix: Allow reactions to be added to an existing comment without providing `message` Skip issues.updateComment call if no message was provided. --- src/main.ts | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/main.ts b/src/main.ts index 62e1ee81..16683a7d 100644 --- a/src/main.ts +++ b/src/main.ts @@ -93,12 +93,15 @@ async function run() { comment_id: number; body: string; }) { - const { data: comment } = await octokit.rest.issues.updateComment({ + const params = { owner, repo, comment_id, - body, - }); + }; + + const { data: comment } = await (body + ? octokit.rest.issues.updateComment({ ...params, body }) + : octokit.rest.issues.getComment(params)); core.setOutput('id', comment.id); core.setOutput('body', comment.body);