вторник, 18 июня 2019 г.

Python gitlab branches

List of branches with excluding protected branches and cherry-pick hotfix revert patch words in name of branches

        gitlab_abc = gitlab.Gitlab(GITLAB_URL, TOKEN, api_version=4)
        project = gitlab_abc.projects.get(ABC_PROJECT)

        branches = project.branches.list(all=True)
        for br in branches:
            if not(br.protected) and "cherry-pick" not in br.name and "revert" not in br.name and "hotfix" not in br.name and "patch" not in br.name:
                print("br.name: ", br.name)
                for k, v in br.commit.items():
                    if k == "committed_date":
                        print("committed_date: ", v)

br.name:  issue-1234
committed_date:  2019-05-15T14:39:35.000+00:00

Комментариев нет:

Отправить комментарий