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
Can't import github_branch_protection using repository node_id:branch pattern #671
Thanks for the bug report @faultylee. The fix has been merged, so it will be in the next release.
@tibbes Are we sure this is resolved? I'm still having issues importing with node_id
Initializing the backend...
Initializing provider plugins...
- Finding integrations/github versions matching "~> 4.0"...
- Installing integrations/github v4.5.1...
- Installed integrations/github v4.5.1 (signed by a HashiCorp partner, key ID 38027F80D7FD5FB2)
$ terraform import github_branch_protection.some_repo 'MDEwOlJlcG9zaXRvcnkxMTE1NjgzNTQ=:master'
github_branch_protection.some_repo: Importing from ID "MDEwOlJlcG9zaXRvcnkxMTE1NjgzNTQ=:master"...
Error: nil entry in ImportState results. This is always a bug with
the resource that is being imported. Please report this as
a bug to Terraform.
@bateller, it looks like there is some missing error checking. Apologies.
I can reproduce that message, but only when the branch protection rule does not exist. I will open a pull request to fix that. Please can you verify that the master branch is actually protected on that repository?
@tibbes Yes, I can confirm master didn't have branch protection.
Sorry about that (I didn't have Admin permission on the repo I was importing)
Tried on another repo within the same org (and with the same Terraform setup) with a repo I had Admin access on and imported branch protection for master successfully.
It appears this issue (and #597) are failing for me due to not checking if the imported resource exists on Github (which would be a nice check for those of us using Terraform to manage Github when we don't have direct Admin access)
Activity
Fix importing github_branch_protection
Fix branch protection import by repository node ID and pattern (#713)
tibbes commentedon Mar 1, 2021
Thanks for the bug report @faultylee. The fix has been merged, so it will be in the next release.
bateller commentedon Mar 8, 2021
@tibbes Are we sure this is resolved? I'm still having issues importing with
node_idtibbes commentedon Mar 8, 2021
@bateller, it looks like there is some missing error checking. Apologies.
I can reproduce that message, but only when the branch protection rule does not exist. I will open a pull request to fix that. Please can you verify that the
masterbranch is actually protected on that repository?bateller commentedon Mar 8, 2021
@tibbes Yes, I can confirm
masterdidn't have branch protection.Sorry about that (I didn't have Admin permission on the repo I was importing)
Tried on another repo within the same org (and with the same Terraform setup) with a repo I had Admin access on and imported branch protection for
mastersuccessfully.It appears this issue (and #597) are failing for me due to not checking if the imported resource exists on Github (which would be a nice check for those of us using Terraform to manage Github when we don't have direct Admin access)
tibbes commentedon Mar 8, 2021
I've opened #721 to fix the error message. Thanks for reporting.
Fix branch protection import by repository node ID and pattern (integ…