integrations / terraform-provider-github

Terraform GitHub provider
https://www.terraform.io/docs/providers/github/
MIT License
888 stars 729 forks source link

[BUG]: branch protection options no longer match GUI options, fail to enable settings on updates #2112

Open devopsrick opened 8 months ago

devopsrick commented 8 months ago

Expected Behavior

github_branch_protection should fully manage all options available under "Branch protection rule" GUI settings.

Actual Behavior

No code options appear to manage the top level "Require a pull request before merging" and "Require approvals" check boxes in settings.

Scenario one: settings already enabled Screenshot 2024-01-22 at 12 19 32

Plan output: Screenshot 2024-01-22 at 12 24 56

Scenario two: settings not enabled Screenshot 2024-01-22 at 12 28 20

Screenshot 2024-01-22 at 12 26 00

Terraform Version

Terraform v1.5.7 on darwin_amd64

Affected Resource(s)

Terraform Configuration Files

resource "github_branch_protection" "master" {
  repository_id = github_repository.repo.node_id
  pattern       = "master"

  required_status_checks {
    strict = "true"
  }

  required_pull_request_reviews {
    dismiss_stale_reviews           = true
    required_approving_review_count = "2"
  }
}

Steps to Reproduce

No response

Debug Output

No response

Panic Output

No response

Code of Conduct

devopsrick commented 7 months ago

Has this gotten any attention? This is basically preventing PR requirements from being enabled via the terraform provider. We have new repositories going out that no longer have correct branch protections and require manual editing.