integrations / terraform-provider-github

Terraform GitHub provider
https://www.terraform.io/docs/providers/github/
MIT License
879 stars 719 forks source link

[BUG]: `github_branch_default` resource should use `repositoryId` instead of `repository` to reference a `repository` resource #2171

Open stefan-hartmann-lgs opened 5 months ago

stefan-hartmann-lgs commented 5 months ago

Expected Behavior

The github_branch_default resource references a repository resource via repositoryId.

Actual Behavior

The github_branch_default resource references a repository resource via repository (repository name).

A lot of other resources already do that correctly.

If a repository is re-named it causes replacement of the github_branch_default resource. Especiallyin combination with rename=true an API call occurs which tries to rename the branch to the same branch name it already has. This results in an HTTP 422 error.

Terraform Version

Terraform v1.7.4 on linux_amd64 + provider registry.terraform.io/integrations/github v6.0.0

Affected Resource(s)

Terraform Configuration Files

No response

Steps to Reproduce

No response

Debug Output

No response

Panic Output

No response

Code of Conduct