feat: tidy sub groups

This commit is contained in:
Karl-Philipp Wulfert
2019-04-30 17:13:20 +02:00
parent 2bdf0e00eb
commit de05b52f24

View File

@@ -341,14 +341,18 @@ export async function tidyIssuesWithoutAssignee(api: Api): Promise<void> {
* @param api GitLab API instance to use for the requests
*/
export async function tidy(api: Api) {
const projects = await getProjects(api, GROUPS);
// get first level sub groups
const groups = GROUPS.slice();
groups.push.apply(groups, (await api.getSubGroupsForGroup(groups[0])).map((group) => group.id));
// get projects of groups
const projects = await getProjects(api, groups);
await Promise.all([
tidyLabels(api, projects),
tidyMilestones(api, projects),
tidyProtectedBranches(api, projects),
tidyProtectedTags(api, projects),
tidySubGroupMembers(api),
]);
await tidyOpenIssuesWithoutMeetingLabel(api);