fix: access commit .diff directly

This commit is contained in:
L.F. Severgnini 2023-07-12 18:15:40 -03:00
parent 012d1cdc1a
commit 110dbf9095
No known key found for this signature in database
GPG Key ID: 7371828D122DAF1E

@ -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;