terraform-provider-github icon indicating copy to clipboard operation
terraform-provider-github copied to clipboard

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

Open devopsrick opened this issue 1 year ago • 1 comments

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

  • provider registry.terraform.io/integrations/github v5.45.0

Affected Resource(s)

  • github_branch_protection

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

  • [X] I agree to follow this project's Code of Conduct

devopsrick avatar Jan 22 '24 11:01 devopsrick

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.

devopsrick avatar Feb 15 '24 07:02 devopsrick