You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add most Premium features for gitlab_branch_protection (#556)
* Rebase and update go.mod
Signed-off-by: Sune Keller <[email protected]>
* Add most Premium features for gitlab_branch_protection
Signed-off-by: Sune Keller <[email protected]>
* Re-work modified schema for gitlab_branch_protection, and update docs
Signed-off-by: Sune Keller <[email protected]>
* Accommodate to name changes from library maintainer
Signed-off-by: Sune Keller <[email protected]>
* Remove invalid check for CE
Signed-off-by: Sune Keller <[email protected]>
* Revert back how merge_access_level and push_access_level are created
Signed-off-by: Sune Keller <[email protected]>
* Simplify expansion of arguments
Signed-off-by: Sune Keller <[email protected]>
* Remove several obsolete functions and make acceptance tests independent of implementation functions
Signed-off-by: Sune Keller <[email protected]>
This resource allows you to protect a specific branch by an access level so that the user with less access level cannot Merge/Push to the branch. GitLab EE features to protect by group or user are not supported.
3
+
This resource allows you to protect a specific branch by an access level so that the user with less access level cannot Merge/Push to the branch.
4
+
5
+
-> The `allowed_to_push`, `allowed_to_merge` and `code_owner_approval_required` arguments require a GitLab Premium account or above.
@@ -21,8 +36,34 @@ The following arguments are supported:
21
36
22
37
*`branch` - (Required) Name of the branch.
23
38
24
-
*`push_access_level` - (Required) One of five levels of access to the project.
39
+
*`push_access_level` - (Optional) One of five levels of access to the project. Valid values are: `no one`, `developer`, `maintainer`, `admin`.
40
+
41
+
*`merge_access_level` - (Optional) One of five levels of access to the project. Valid values are: `no one`, `developer`, `maintainer`, `admin`.
25
42
26
-
*`merge_access_level`- (Required) One of five levels of access to the project.
43
+
*`allowed_to_push`, `allowed_to_merge`- (Optional) One or more `allowed_to_push`, `allowed_to_merge` blocks as defined below.
27
44
28
45
*`code_owner_approval_required` (Optional) Bool, defaults to false. Can be set to true to require code owner approval before merging.
46
+
47
+
---
48
+
49
+
An `allowed_to_push` or `allowed_to_merge` block supports the following arguments:
50
+
51
+
*`user_id` - (Required) The ID of a GitLab user allowed to perform the relevant action. Mutually exclusive with `group_id`.
52
+
53
+
*`group_id` - (Required) The ID of a GitLab group allowed to perform the relevant action. Mutually exclusive with `user_id`.
54
+
55
+
56
+
## Attributes Reference
57
+
58
+
The following attributes are exported:
59
+
60
+
* The `allowed_to_push` and `allowed_to_merge` blocks export the `access_level_description` field, which contains a textual description of the access level, user or group allowed to perform the relevant action.
61
+
62
+
## Import
63
+
64
+
GitLab project freeze periods can be imported using an id made up of `project_id:branch`, e.g.
0 commit comments