Skip to content

Protected Branches Group Level #3164

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
xakepnz opened this issue Apr 4, 2025 · 0 comments · Fixed by #3170
Closed

Protected Branches Group Level #3164

xakepnz opened this issue Apr 4, 2025 · 0 comments · Fixed by #3170

Comments

@xakepnz
Copy link
Contributor

xakepnz commented Apr 4, 2025

Group Protected Branches

Feature Request to create the protected_branches attr for the Group class.

The ability exists over API to query this: (docs)

curl --header "PRIVATE-TOKEN: <your_access_token>" \
  --url "https://gitlab.example.com/api/v4/groups/5/protected_branches"

e.g.

>>> group = gl.groups.get('56')
>>> pb = group.protectedbranches.list(get_all=True)
>>> pb

[
  {
    "id": 1,
    "name": "main",
    "push_access_levels": [
      {
        "id":  1,
        "access_level": 40,
        "user_id": null,
        "group_id": 1234,
        "access_level_description": "Maintainers"
      }
    ],
    "merge_access_levels": [
      {
        "id":  1,
...

ref: https://gitlab.com/gitlab-security-oss/cis/gitlabcis/-/issues/125

Specifications

  • python-gitlab version: 5.6.0
  • Gitlab server version (or gitlab.com): GitLab Enterprise Edition 17.11.0-pre 76ac92593a5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant