Merge pull request #7133 from kim5566/fix/pagination-selected-git-repos
add paginate to selected git repos
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
---
|
||||
'@backstage/integration': patch
|
||||
---
|
||||
|
||||
Handle pagination on return results when fetch GitHub API to list selected repos
|
||||
@@ -110,9 +110,10 @@ class GithubAppManager {
|
||||
const installationClient = new Octokit({
|
||||
auth: result.data.token,
|
||||
});
|
||||
const repos =
|
||||
await installationClient.apps.listReposAccessibleToInstallation();
|
||||
const hasRepo = repos.data.repositories.some(repository => {
|
||||
const repos = await installationClient.paginate(
|
||||
installationClient.apps.listReposAccessibleToInstallation,
|
||||
);
|
||||
const hasRepo = repos.some(repository => {
|
||||
return repository.name === repo;
|
||||
});
|
||||
if (!hasRepo) {
|
||||
|
||||
Reference in New Issue
Block a user