Skip to content

Commit

Permalink
Allow to set required_approving_review_count=0
Browse files Browse the repository at this point in the history
  • Loading branch information
jtyr committed Nov 22, 2021
1 parent b413047 commit 5c806b4
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion github/resource_github_branch_protection.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ func resourceGithubBranchProtection() *schema.Resource {
Type: schema.TypeInt,
Optional: true,
Default: 1,
ValidateFunc: validation.IntBetween(1, 6),
ValidateFunc: validation.IntBetween(0, 6),
},
PROTECTION_REQUIRES_CODE_OWNER_REVIEWS: {
Type: schema.TypeBool,
Expand Down
2 changes: 1 addition & 1 deletion github/resource_github_branch_protection_v3.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ func resourceGithubBranchProtectionV3() *schema.Resource {
Type: schema.TypeInt,
Optional: true,
Default: 1,
ValidateFunc: validation.IntBetween(1, 6),
ValidateFunc: validation.IntBetween(0, 6),
},
},
},
Expand Down
2 changes: 1 addition & 1 deletion website/docs/r/branch_protection.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ The following arguments are supported:
* `restrict_dismissals`: (Optional) Restrict pull request review dismissals.
* `dismissal_restrictions`: (Optional) The list of actor IDs with dismissal access. If not empty, `restrict_dismissals` is ignored.
* `require_code_owner_reviews`: (Optional) Require an approved review in pull requests including files with a designated code owner. Defaults to `false`.
* `required_approving_review_count`: (Optional) Require x number of approvals to satisfy branch protection requirements. If this is specified it must be a number between 1-6. This requirement matches GitHub's API, see the upstream [documentation](https://developer.github.com/v3/repos/branches/#parameters-1) for more information.
* `required_approving_review_count`: (Optional) Require x number of approvals to satisfy branch protection requirements. If this is specified it must be a number between 0-6. This requirement matches GitHub's API, see the upstream [documentation](https://developer.github.com/v3/repos/branches/#parameters-1) for more information.


## Import
Expand Down
2 changes: 1 addition & 1 deletion website/docs/r/branch_protection_v3.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ The following arguments are supported:
* `dismissal_teams`: (Optional) The list of team slugs with dismissal access.
Always use `slug` of the team, **not** its name. Each team already **has** to have access to the repository.
* `require_code_owner_reviews`: (Optional) Require an approved review in pull requests including files with a designated code owner. Defaults to `false`.
* `required_approving_review_count`: (Optional) Require x number of approvals to satisfy branch protection requirements. If this is specified it must be a number between 1-6. This requirement matches GitHub's API, see the upstream [documentation](https://developer.github.com/v3/repos/branches/#parameters-1) for more information.
* `required_approving_review_count`: (Optional) Require x number of approvals to satisfy branch protection requirements. If this is specified it must be a number between 0-6. This requirement matches GitHub's API, see the upstream [documentation](https://developer.github.com/v3/repos/branches/#parameters-1) for more information.

### Restrictions

Expand Down

0 comments on commit 5c806b4

Please sign in to comment.