Skip to content

Commit e126a43

Browse files
authored
[docs]: update comments for github_branch_protection in case of push_restrictions
2 parents 8753d3c + f3a762c commit e126a43

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

website/docs/r/branch_protection.html.markdown

+7-2
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ Protects a GitHub branch.
1111

1212
This resource allows you to configure branch protection for repositories in your organization. When applied, the branch will be protected from forced pushes and deletion. Additional constraints, such as required status checks or restrictions on users, teams, and apps, can also be configured.
1313

14+
Note: for the `push_restrictions` a given user or team must have specific write access to the repository. If specific write access not provided, github will reject the given actor, which will be the cause of terraform drift.
15+
1416
## Example Usage
1517

1618
```hcl
@@ -47,16 +49,19 @@ resource "github_branch_protection" "example" {
4749
data.github_user.example.node_id,
4850
"/exampleuser",
4951
"exampleorganization/exampleteam",
50-
# limited to a list of one type of restriction (user, team, app)
52+
# you can have more than one type of restriction (teams + users). If you use
53+
# more than one type, you must use node_ids of each user and each team.
5154
# github_team.example.node_id
55+
# github_user.example-2.node_id
5256
]
5357
5458
force_push_bypassers = [
5559
data.github_user.example.node_id,
5660
"/exampleuser",
5761
"exampleorganization/exampleteam",
58-
# limited to a list of one type of restriction (user, team, app)
62+
# you can have more than one type of restriction (teams + users)
5963
# github_team.example.node_id
64+
# github_team.example-2.node_id
6065
]
6166
6267
}

0 commit comments

Comments
 (0)