From 110dbf9095ae202f710b08795522227363c7fd83 Mon Sep 17 00:00:00 2001 From: "L.F. Severgnini" Date: Wed, 12 Jul 2023 18:15:40 -0300 Subject: [PATCH] fix: access commit .diff directly --- src/main.ts | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/main.ts b/src/main.ts index c9f7144..e897012 100644 --- a/src/main.ts +++ b/src/main.ts @@ -212,17 +212,16 @@ async function main() { const newHeadSha = eventData.after; const response = await octokit.repos.compareCommits({ + headers: { + accept: "application/vnd.github.v3.diff", + }, owner: prDetails.owner, repo: prDetails.repo, base: newBaseSha, head: newHeadSha, }); - diff = response.data.diff_url - ? await octokit - .request({ url: response.data.diff_url }) - .then((res) => res.data) - : null; + diff = String(response.data); } else { console.log("Unsupported event:", process.env.GITHUB_EVENT_NAME); return;