-
Notifications
You must be signed in to change notification settings - Fork 764
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Can't import github_branch_protection using repository node_id:branch pattern #671
Comments
Importing a branch protection rule by an ID of the form <repo-node-id>:<pattern> was broken. Closes: integrations#671
* Add test for importing github_branch_protection There was an existing test for importing by <repo-name>:<pattern>, but not a test for <repo-node-id>:<pattern>. * Fix importing github_branch_protection Importing a branch protection rule by an ID of the form <repo-node-id>:<pattern> was broken. Closes: #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
|
@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 |
@tibbes Yes, I can confirm 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 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) |
I've opened #721 to fix the error message. Thanks for reporting. |
…rations#713) * Add test for importing github_branch_protection There was an existing test for importing by <repo-name>:<pattern>, but not a test for <repo-node-id>:<pattern>. * Fix importing github_branch_protection Importing a branch protection rule by an ID of the form <repo-node-id>:<pattern> was broken. Closes: integrations#671
Terraform Version
terraform-provider-github_v4.2.0
Affected Resource(s)
Debug Output
I had to masked the
org
https://gist.github.com/faultylee/0fa1a34cade6ee047f9e81967fd93993
Expected Behavior
Import of branch_protection works with
node_id
Actual Behavior
node_id
use during import was interpreted as repo_nameSteps to Reproduce
terraform init
terraform import github_branch_protection.repo_branch_protection 'MDEwOlJlcG9zaXRvcnkzMzI2ODM4OTc=:main'
References
node_id
has issue and wasn't testedThe text was updated successfully, but these errors were encountered: