summaryrefslogtreecommitdiff
path: root/doc/api/protected_branches.md
diff options
context:
space:
mode:
Diffstat (limited to 'doc/api/protected_branches.md')
-rw-r--r--doc/api/protected_branches.md28
1 files changed, 23 insertions, 5 deletions
diff --git a/doc/api/protected_branches.md b/doc/api/protected_branches.md
index e5560360532..2fe821a7758 100644
--- a/doc/api/protected_branches.md
+++ b/doc/api/protected_branches.md
@@ -22,7 +22,7 @@ The access levels are defined in the `ProtectedRefAccess.allowed_access_levels`
## List protected branches
-Gets a list of protected branches from a project.
+Gets a list of protected branches from a project as they are defined [in the UI](../user/project/protected_branches.md#configure-a-protected-branch). If a wildcard is set, it is returned instead of the exact name of the branches that match that wildcard.
```plaintext
GET /projects/:id/protected_branches
@@ -59,6 +59,24 @@ Example response:
"allow_force_push":false,
"code_owner_approval_required": false
},
+ {
+ "id": 1,
+ "name": "release/*",
+ "push_access_levels": [
+ {
+ "access_level": 40,
+ "access_level_description": "Maintainers"
+ }
+ ],
+ "merge_access_levels": [
+ {
+ "access_level": 40,
+ "access_level_description": "Maintainers"
+ }
+ ],
+ "allow_force_push":false,
+ "code_owner_approval_required": false
+ },
...
]
```
@@ -183,10 +201,10 @@ curl --request POST --header "PRIVATE-TOKEN: <your_access_token>" "https://gitla
| --------- | ---- | -------- | ----------- |
| `id` | integer/string | yes | The ID or [URL-encoded path of the project](README.md#namespaced-path-encoding) owned by the authenticated user |
| `name` | string | yes | The name of the branch or wildcard |
-| `push_access_level` | string | no | Access levels allowed to push (defaults: `40`, maintainer access level) |
-| `merge_access_level` | string | no | Access levels allowed to merge (defaults: `40`, maintainer access level) |
-| `unprotect_access_level` | string | no | Access levels allowed to unprotect (defaults: `40`, maintainer access level) |
-| `allow_force_push` | boolean | no | Allow force push for all users with push access. (defaults: false) |
+| `push_access_level` | string | no | Access levels allowed to push (defaults: `40`, Maintainer role) |
+| `merge_access_level` | string | no | Access levels allowed to merge (defaults: `40`, Maintainer role) |
+| `unprotect_access_level` | string | no | Access levels allowed to unprotect (defaults: `40`, Maintainer role) |
+| `allow_force_push` | boolean | no | Allow all users with push access to force push. (default: `false`) |
| `allowed_to_push` | array | no | **(PREMIUM)** Array of access levels allowed to push, with each described by a hash |
| `allowed_to_merge` | array | no | **(PREMIUM)** Array of access levels allowed to merge, with each described by a hash |
| `allowed_to_unprotect` | array | no | **(PREMIUM)** Array of access levels allowed to unprotect, with each described by a hash |