feat(gitlab): support nested group filtering using namespace.full_path.startsWith

This commit is contained in:
avalolu 2025-05-26 18:00:03 -04:00
parent 27b2106630
commit 560d493d56

View File

@ -255,7 +255,9 @@ export const getGitlabRepositories = async (gitlabId?: string) => {
if (groupName) {
const isIncluded = groupName
.split(",")
.some((name) => full_path === name);
.some((name) =>
full_path.toLowerCase().startsWith(name.trim().toLowerCase())
);
return isIncluded && kind === "group";
}
@ -422,7 +424,12 @@ export const testGitlabConnection = async (
const { full_path, kind } = repo.namespace;
if (groupName) {
return groupName.split(",").some((name) => full_path === name);
return groupName
.split(",")
.some((name) =>
full_path.toLowerCase().startsWith(name.trim().toLowerCase())
);
}
return kind === "user";
});