Skip to content

Commit

Permalink
add paginate
Browse files Browse the repository at this point in the history
Signed-off-by: kim5566 <qi.jin@anz.com>
  • Loading branch information
kim5566 committed Sep 10, 2021
1 parent 04f1806 commit cc5c8f4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/tidy-shoes-occur.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@backstage/integration': patch
---

Handle pagination on return results when fetch Github API to list selected repos
4 changes: 2 additions & 2 deletions packages/integration/src/github/GithubCredentialsProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,8 @@ class GithubAppManager {
auth: result.data.token,
});
const repos =
await installationClient.apps.listReposAccessibleToInstallation();
const hasRepo = repos.data.repositories.some(repository => {
await installationClient.paginate(installationClient.apps.listReposAccessibleToInstallation);
const hasRepo = repos && repos.repositories.some(repository => {
return repository.name === repo;
});
if (!hasRepo) {
Expand Down

0 comments on commit cc5c8f4

Please sign in to comment.