mirror of
https://github.com/freeedcom/ai-codereviewer.git
synced 2025-04-19 09:06:47 +00:00
Merge pull request #14 from lfsevergnini/fix/access-diff-directly
fix: access diff directly to enable support to private repositories
This commit is contained in:
commit
0939fc4e8d
3 changed files with 9 additions and 11 deletions
|
@ -213,17 +213,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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue