You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[BUG]: cannot unmarshal object into Go struct field Protection.lock_branch of type bool after upgrade to v5.13.0 #1476
With Terraform config that could successfully execute a plan using module version v5.12.0.
I expect to be able to successfully execute a plan when upgrading to v5.13.0.
Actual Behaviour
I receive an error unmarshalling an existing branch protection
│ Error: json: cannot unmarshal object into Go struct field Protection.lock_branch of type bool
│
│ with module.repository["<repo_name>"].github_branch_protection_v3.branch_protection[0],
│ on .terraform/modules/repository/main.tf line 240, in resource "github_branch_protection_v3""branch_protection":
│ 240:resource"github_branch_protection_v3""branch_protection" {
│
Diagnosis
As alluded to in this comment, the module has recently updated go-github from 48.1.0 to 48.2.0 (#1425).
I'm assuming that the SDK adding support for the lock_branch property from the API response (added here), is causing the unmarshalling to fail, and this could perhaps be fixed by adding a lock_branch property to the branch protection state
Activity
TheQueenIsDead commentedon Jan 16, 2023
As @kfcampbell mentioned, this is resolved for me in the 5.14.0 release due to: