Skip to content
This repository has been archived by the owner on Apr 3, 2023. It is now read-only.

Commit

Permalink
feat: fetch the collaborator list completely
Browse files Browse the repository at this point in the history
  • Loading branch information
Mini256 committed Nov 29, 2020
1 parent bd36051 commit 79e99d5
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
15 changes: 10 additions & 5 deletions src/api/pull/index.ts
Expand Up @@ -82,11 +82,16 @@ export async function listOwners(
};
});

// FIXME: Fetch the collaborator list completely, not pagination
const { data: collaboratorInfos } = await github.repos.listCollaborators({
owner,
repo,
});
// Notice:The `github.paginate` API loads the next page data against the link attribute in response's header
// TODO: Add paginated test case for the listCollaborators API
const collaboratorInfos = await github.paginate(
github.repos.listCollaborators,
{
owner,
repo,
},
(res) => res.data
);

const collaborators = collaboratorInfos.map((c) => {
return {
Expand Down
1 change: 1 addition & 0 deletions src/config/SigInfoSchema.ts
@@ -1,5 +1,6 @@
export interface ContributorSchema {
githubName: string;
// The optional flag is set for some api returned the contributor without permissions
permissions?: {
pull: boolean;
push: boolean;
Expand Down

0 comments on commit 79e99d5

Please sign in to comment.