Fix Public Repos without auth
Change API endpoint to allow the pulling of public repos without a Github token. Also remove unneeded username reference.pull/1/head
parent
445b9642ca
commit
a1c89bfcee
|
@ -8,12 +8,12 @@ async function getGithubRepositories(username, token, mirrorPrivateRepositories)
|
|||
auth: token || null,
|
||||
});
|
||||
|
||||
const publicRepositoriesWithForks = await octokit.paginate('GET /user/repos?visibility=public&affiliation=owner&visibility=public', { username: username })
|
||||
const publicRepositoriesWithForks = await octokit.paginate('GET /users/:username/repos', { username: username })
|
||||
.then(repositories => toRepositoryList(repositories));
|
||||
|
||||
let allRepositoriesWithoutForks;
|
||||
if(mirrorPrivateRepositories === 'true'){
|
||||
allRepositoriesWithoutForks = await octokit.paginate('GET /user/repos?visibility=public&affiliation=owner&visibility=private', { username : username })
|
||||
allRepositoriesWithoutForks = await octokit.paginate('GET /user/repos?visibility=public&affiliation=owner&visibility=private')
|
||||
.then(repositories => toRepositoryList(repositories));
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue