Merge pull request #1656 from lorenzomigliorero/support-multiple-gitlab-groups

feat(gitlab): add support for multiple group names with a single provider
This commit is contained in:
Mauricio Siu
2025-04-17 02:20:29 -06:00
committed by GitHub
3 changed files with 14 additions and 4 deletions

View File

@@ -264,7 +264,11 @@ export const getGitlabRepositories = async (gitlabId?: string) => {
const groupName = gitlabProvider.groupName?.toLowerCase();
if (groupName) {
return full_path.toLowerCase().includes(groupName) && kind === "group";
const isIncluded = groupName
.split(",")
.some((name) => full_path.toLowerCase().includes(name));
return isIncluded && kind === "group";
}
return kind === "user";
});
@@ -431,7 +435,9 @@ export const testGitlabConnection = async (
const { full_path, kind } = repo.namespace;
if (groupName) {
return full_path.toLowerCase().includes(groupName) && kind === "group";
return groupName
.split(",")
.some((name) => full_path.toLowerCase().includes(name));
}
return kind === "user";
});