Skip to content

Commit

Permalink
feat: filter gitlab projects that are shared (#326)
Browse files Browse the repository at this point in the history
  • Loading branch information
IlanTSnyk authored May 17, 2022
1 parent ceb3323 commit 632f3a9
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/lib/source-handlers/gitlab/list-repos.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,10 @@ export async function fetchGitlabReposForPage(
hasNextPage = true;
repoData.push(
...projects
.filter((project: any) => !project.archived)
.filter(
(project: any) =>
!project.archived && project.shared_with_groups?.length == 0,
)
.map((project: any) => ({
fork: !!project.forked_from_project,
name: project.path_with_namespace,
Expand Down
3 changes: 3 additions & 0 deletions test/lib/source-handlers/gitlab/list-repos.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,8 @@ describe('listGitlabRepos', () => {
branch: expect.any(String),
fork: expect.any(Boolean),
});
for (let i = 0; i < repos.length; i ++){
expect(repos[i].name).not.toContain("shared-with-group");
}
});
});

0 comments on commit 632f3a9

Please sign in to comment.