-
Notifications
You must be signed in to change notification settings - Fork 763
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
Branch protection rule failed to be created with new format Github repository node_id #908
Comments
Hello, I’ve the same issue. In the meantime, using the name attribute of the github_repository resource seems to work. |
I'm also having this issue, but it seems weirdly intermittent. My module uses the repository I've managed to work around this by adding some brute-force logic like so: repository_id = local.default_branch._repo_id_escape_hatch ? github_repository.repo.name : github_repository.repo.node_id |
This resolves issue caused by moving to use the v4 API for this resouce, as part of provider version: 3.1.0 Issue: integrations/terraform-provider-github#908 Provider bump: integrations/terraform-provider-github#337 Signed-off-by: Stefan Wessels Beljaars <[email protected]>
Also hit this issue. Using this as a workaround for now:
|
The workaround mentioned doesn't work if your |
+1 on this, if you rename a repository, the |
This was mentioned in a PR that merged in November, but no release fixes it yet. Can we get an update on when we can expect to have this working, particularly for resources that include a loop? As noted by @ayk33, the ternary check doesn't work properly in a looping resource. |
node_id is currently broken, see gh issue integrations/terraform-provider-github#908 Note that this means if the name changes the protection apply will break.
For folks still hitting this issue, I just wanted to share that I also got the same error response after mistakenly using the For example, I had the following:
which should instead be:
|
👋 hi! Is this still an issue with current versions of the provider? It looks like #914 may have resolved it. |
I'm seeing the same error with |
I also had the same issue, trying to configure resource "github_branch_protection" "main" {
repository_id = github_repository.this.node_id
pattern = "main"
required_pull_request_reviews {
# [...]
pull_request_bypassers = [
"my-org/my-user",
]
}
} I turned out that I was using a wrong user identifier in the I found this by running Terraform with
I doubled checked the content using https://docs.github.com/en/graphql/overview/explorer and indeed it couldn't find the user. I fixed that and uses a correct user and it worked afterwards. (Actually, I wanted to allow a specific GitHub App to bypass mandatory pull requests, so I fetched the |
v5.18.0 fixed the similar issue I was getting for |
Closing this issue as it appears resolved. Please reopen with a descriptive comment if that's not the case! |
With Github migrating the repository's GraphQL global node ID to new format, branch protection rule resource cannot be created with
node_id
because the new format of node ID is no longer encoded by Base64.Branch protection rule setup with repository name is still working correctly without being affected.
Terraform Version
0.14.11
Affected Resource(s)
Terraform Configuration Files
Expected Behavior
Branch protection rule should be created in the new repository.
Actual Behavior
Error reported as following:
Steps to Reproduce
terraform apply
The text was updated successfully, but these errors were encountered: