Getting a 404 error whenever I fork a repo

500 Views Asked by At

I'm trying to create a website that can fork a repo using Octokit, but I keep getting 404 errors.

const octokit = new Octokit({
    auth: accessToken
})
  
try {
    const response = await octokit.request('POST /repos/{owner}/{repo}/forks', {
        owner: 'google',
        repo: 'googletest'
    })
    console.log(response)
}
catch(e) {
    console.log(e)
}

RESPONSE:

POST https://api.github.com/repos/google/googletest/forks 404
HttpError: Not Found

NOTE: The personal access token has repo permissions allowed. The Github client ID and secret are valid.

I'm not sure what else to try.

0

There are 0 best solutions below