-
Notifications
You must be signed in to change notification settings - Fork 949
[BUG] Cannot switch default branch back to master #193
Copy link
Copy link
Closed
Labels
Description
Switching default branch to something other than master, then attempting to switch it back to master again results in success being reported, but the default branch not changing back to master.
Problem is here: https://github.com/terraform-providers/terraform-provider-github/blob/master/github/resource_github_repository.go#L248 - it will only ever update default branch if it's NOT master.
Terraform Version
Terraform v0.11.11
- provider.github v1.3.0
Affected Resource(s)
- github_repository
Terraform Configuration Files
resource "github_repository" "main" {
name = "my-repo-12345"
private = true
auto_init = true
}then create develop branch and:
resource "github_repository" "main" {
name = "my-repo-12345"
private = true
auto_init = true
default_branch = "develop"
}then:
resource "github_repository" "main" {
name = "my-repo-12345"
private = true
auto_init = true
default_branch = "master"
}Expected Behavior
Default branch should be switched back to master once the third step above is run.
Actual Behavior
Default branch is left as develop.
Steps to Reproduce
See config files above.
Reactions are currently unavailable