From 24d9b9e2b44aed341fb8def149c5f2f77b2bd7c7 Mon Sep 17 00:00:00 2001 From: Tomoya Kashifuku Date: Sun, 3 Mar 2024 14:34:07 +0900 Subject: [PATCH] show user object --- dist/index.js | 10 ++++------ src/main.ts | 10 ++++------ 2 files changed, 8 insertions(+), 12 deletions(-) diff --git a/dist/index.js b/dist/index.js index f32e97f..ad8f715 100644 --- a/dist/index.js +++ b/dist/index.js @@ -29029,7 +29029,7 @@ async function run() { owner, repo, issue_number: prNumber - })).data.filter(comment => comment.user?.id === github_1.context.runId); + })).data; const reviewComments = (await octokit.rest.pulls.listReviewComments({ owner, repo, @@ -29039,11 +29039,9 @@ async function run() { owner, repo, issue_number: prNumber, - body: `the number of the comments is ${comments.length}\ncontents: \n${comments.map(c => `- ${c.user?.name}, ${c.body}`).join('\n')} - - the number of the comments is ${comments.length}\ncontents: \n${comments.map(c => `- ${c.user?.id}, ${c.body}`).join('\n')} - - the number of the review comments is ${reviewComments.length}\ncontents: \n${reviewComments.map(c => `- ${c.user?.id}, ${c.body}`).join('\n')}` + body: `the number of the comments is ${comments.length}\ncontents: \n${comments.map(c => `- ${JSON.stringify(c.user)}, ${c.body}`).join('\n')} + + the number of the review comments is ${reviewComments.length}\ncontents: \n${reviewComments.map(c => `- ${JSON.stringify(c.user)}, ${c.body}`).join('\n')}` }); core.debug(`Commented on PR #${prNumber}`); } diff --git a/src/main.ts b/src/main.ts index 61be787..46541ab 100644 --- a/src/main.ts +++ b/src/main.ts @@ -28,7 +28,7 @@ export async function run(): Promise { repo, issue_number: prNumber }) - ).data.filter(comment => comment.user?.id === context.runId) + ).data const reviewComments = ( await octokit.rest.pulls.listReviewComments({ @@ -42,11 +42,9 @@ export async function run(): Promise { owner, repo, issue_number: prNumber, - body: `the number of the comments is ${comments.length}\ncontents: \n${comments.map(c => `- ${c.user?.name}, ${c.body}`).join('\n')} - - the number of the comments is ${comments.length}\ncontents: \n${comments.map(c => `- ${c.user?.id}, ${c.body}`).join('\n')} - - the number of the review comments is ${reviewComments.length}\ncontents: \n${reviewComments.map(c => `- ${c.user?.id}, ${c.body}`).join('\n')}` + body: `the number of the comments is ${comments.length}\ncontents: \n${comments.map(c => `- ${JSON.stringify(c.user)}, ${c.body}`).join('\n')} + + the number of the review comments is ${reviewComments.length}\ncontents: \n${reviewComments.map(c => `- ${JSON.stringify(c.user)}, ${c.body}`).join('\n')}` }) core.debug(`Commented on PR #${prNumber}`) } catch (error) {