mirror of
https://github.com/freeedcom/ai-codereviewer.git
synced 2024-12-03 17:39:02 +00:00
fix: access commit .diff directly
This commit is contained in:
parent
012d1cdc1a
commit
110dbf9095
@ -212,17 +212,16 @@ async function main() {
|
|||||||
const newHeadSha = eventData.after;
|
const newHeadSha = eventData.after;
|
||||||
|
|
||||||
const response = await octokit.repos.compareCommits({
|
const response = await octokit.repos.compareCommits({
|
||||||
|
headers: {
|
||||||
|
accept: "application/vnd.github.v3.diff",
|
||||||
|
},
|
||||||
owner: prDetails.owner,
|
owner: prDetails.owner,
|
||||||
repo: prDetails.repo,
|
repo: prDetails.repo,
|
||||||
base: newBaseSha,
|
base: newBaseSha,
|
||||||
head: newHeadSha,
|
head: newHeadSha,
|
||||||
});
|
});
|
||||||
|
|
||||||
diff = response.data.diff_url
|
diff = String(response.data);
|
||||||
? await octokit
|
|
||||||
.request({ url: response.data.diff_url })
|
|
||||||
.then((res) => res.data)
|
|
||||||
: null;
|
|
||||||
} else {
|
} else {
|
||||||
console.log("Unsupported event:", process.env.GITHUB_EVENT_NAME);
|
console.log("Unsupported event:", process.env.GITHUB_EVENT_NAME);
|
||||||
return;
|
return;
|
||||||
|
Loading…
Reference in New Issue
Block a user