Commit abe2d341 authored by Adrian DC's avatar Adrian DC
Browse files

feat(entrypoint): keep description if already contains group

Signed-off-by: default avatarAdrian DC <radian.dc@gmail.com>
parent 3861e78d
Loading
Loading
Loading
Loading
+11 −0
Changes for src/cli/entrypoint.py: 11 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -152,12 +152,18 @@ class Entrypoint:
                    parent_description,
                    parent_name,
                )
            if not parent_description_text or not group.description.endswith(
                    f'{parent_description_text}'):
                description = f'{GitLabFeature.Helper.capitalize(group.name)}' \
                            f'{parent_description_text}'
                gitlab.group_set_description(criteria, description)
                print(f'{Colors.BOLD}   - Updated description: '
                      f'{Colors.CYAN}{description}'
                      f'{Colors.RESET}')
            else:
                print(f'{Colors.BOLD}   - Kept description: '
                      f'{Colors.GREEN}{group.description}'
                      f'{Colors.RESET}')

        # Reset group members
        if options.reset_members:
@@ -210,12 +216,17 @@ class Entrypoint:
                group.description,
                group.name,
            )
            if not project.description.endswith(f' - {group_description}'):
                description = f'{GitLabFeature.Helper.capitalize(project.name)}' \
                              f' - {group_description}'
                gitlab.project_set_description(criteria, description)
                print(f'{Colors.BOLD}   - Updated description: '
                      f'{Colors.CYAN}{description}'
                      f'{Colors.RESET}')
            else:
                print(f'{Colors.BOLD}   - Kept description: '
                      f'{Colors.GREEN}{project.description}'
                      f'{Colors.RESET}')

        # Reset project features
        if options.reset_features: