Skip to content
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

[docs]: update comments for github_branch_protection in case of push_restrictions #1945

Merged
merged 4 commits into from
Oct 10, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions website/docs/r/branch_protection.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ Protects a GitHub branch.

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.

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.

## Example Usage

```hcl
Expand Down Expand Up @@ -47,16 +49,19 @@ resource "github_branch_protection" "example" {
data.github_user.example.node_id,
"/exampleuser",
"exampleorganization/exampleteam",
# limited to a list of one type of restriction (user, team, app)
# you can have more than one type of restriction (teams + users). If you use
# more than one type, you must use node_ids of each user and each team.
# github_team.example.node_id
# github_user.example-2.node_id
]

force_push_bypassers = [
data.github_user.example.node_id,
"/exampleuser",
"exampleorganization/exampleteam",
# limited to a list of one type of restriction (user, team, app)
# you can have more than one type of restriction (teams + users)
# github_team.example.node_id
# github_team.example-2.node_id
]

}
Expand Down