integrations / terraform-provider-github

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

[BUG]: Argument error - An argument named "blocks_creations" is not expected here. #2166

Closed gh-risharma closed 5 months ago

gh-risharma commented 6 months ago

Expected Behavior

Earlier the job ran successfully with the same argument mentioned in github_branch_protection resource

Actual Behavior

But now its failing with the above error.

Terraform Version

1.7.4

Affected Resource(s)

-github_branch_protection

Terraform Configuration Files

No response

Steps to Reproduce

No response

Debug Output

No response

Panic Output

No response

Code of Conduct

gh-risharma commented 6 months ago

image

bradam12 commented 6 months ago

The 6.0.0 release modified those two args into a new block.

https://github.com/integrations/terraform-provider-github/pull/2045 https://registry.terraform.io/providers/integrations/github/latest/docs/resources/branch_protection#restrict-pushes

georgekaz commented 5 months ago

This isn't a bug, it's a breaking change in v6 as bradam12 says, to resolve #594.

Change your code from

resource "github_branch_protection" "example" {
  push_restrictions = []
  blocks_creations = false
}

to

resource "github_branch_protection" "example" {
  restrict_pushes {
    blocks_creations = false
  }
}

This issue should be closed @kfcampbell

kfcampbell commented 5 months ago

👍 thanks @georgekaz