integrations / terraform-provider-github

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

[BUG]: github_branch_protection allow_force_pushes permanent diff when force_push_bypassers is specified #2054

Closed derhally closed 7 months ago

derhally commented 9 months ago

Expected Behavior

Value for allows_force_pushes should remain constant after apply even if force_push_bypassers are set

Actual Behavior

allows_force_pushes sticks to false even though it is shows enabled in the GitHub console

image

image

Terraform Version

Terraform v1.3.8 on linux_amd64

I tested this with terraform 1.6 and the github provider vs 5.52.0 as well.

Affected Resource(s)

github_branch_protection

Terraform Configuration Files

resource "github_branch_protection" "this" {
  repository_id = github_repository.this.node_id

  pattern = "main"
  allows_force_pushes             = true
  force_push_bypassers            = [ "org/team1" ]
}

Steps to Reproduce

Run terraform apply

Then run terraform plan and you should see terraform trying to change allows_force_pushes from false to true

Debug Output

No response

Panic Output

No response

Code of Conduct