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

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

Open gh-risharma opened this issue 1 year ago • 2 comments
trafficstars

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

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

gh-risharma avatar Feb 22 '24 09:02 gh-risharma

image

gh-risharma avatar Feb 22 '24 09:02 gh-risharma

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

bradam12 avatar Feb 22 '24 20:02 bradam12

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

georgekaz avatar Mar 08 '24 15:03 georgekaz

👍 thanks @georgekaz

kfcampbell avatar Mar 08 '24 17:03 kfcampbell