-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Open
Labels
Status: TriageThis is being looked at and prioritizedThis is being looked at and prioritizedType: BugSomething isn't working as documentedSomething isn't working as documented
Description
What happened?
Simply trying to access a diff of a PR, but it always return 404(works only for public repos).
All other APIs that require authentication work (List pull request for example).
Only when trying to access the diff URL,it doesn't, and return 404.
It is accessible using the browser under authenticated session, but the API - 404.
Any idea?
export default async function handler(req: NextApiRequest, res: NextApiResponse) {
if (req.method === 'POST') {
const payload = req.body;
if (payload.action === 'opened' && payload.pull_request) { // Process only 'opened' PR events
const diffUrl = prData.diff_url;
console.log(`New PR opened: #${prNumber} in ${repoOwner} ${repoName}`);
console.log(`Diff URL: ${diffUrl}`);
try {
const diffResponse = await octokit.request({
method: 'GET',
url: diffUrl,
headers: {
'Accept': 'application/vnd.github.v3.diff' // Request raw diff
}
});
}
Versions
"octokit": "^4.1.2",
Relevant log output
curl -H "Authorization: token github_pat_my_token_here" https://github.com/theunreal/codesight/pull/11.diff
Not Found%
Code of Conduct
- I agree to follow this project's Code of Conduct
Metadata
Metadata
Assignees
Labels
Status: TriageThis is being looked at and prioritizedThis is being looked at and prioritizedType: BugSomething isn't working as documentedSomething isn't working as documented
Type
Projects
Status
🔥 Backlog