-
Notifications
You must be signed in to change notification settings - Fork 775
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
Allow Setting the github_repository.default_branch on creation to any designated value #513
Comments
I'll add my support for this. This restriction effectively means that this isn't actually a declarative representation of a GitHub repository. Imagine you're trying to migrate from GitHub to GitHub Enterprise, let's say. How do you define the repositories declaratively? You can't. Instead, you might be inclined to use something like Ansible to do this, since you are forced to reason about this in an imperative fashion anyway. If you can't specify the I think the best approach so that this can behave in a declarative fashion is to create the branch if it doesn't exist. Obviously this would only work with If someone's more familiar than I am with this provider code, have at it. Otherwise, I can take a look and see if I can figure it out. |
☝️ has shipped which aligns our testing to the new state of repositories that are created. The planned next step here is to add logic to create the branch requested by |
I would like to use the default Creating a new Repository:When creating a new Repository, I'd like to be able to specify a For example: resource "github_repository" "test" {
name = "repo-with-default-branch-develop"
description = "Repository with a default branch other than main"
default_branch = "develop"
auto_init = true
}
resource "github_branch_protection" "example" {
repository = github_repository.test.name
branch = "develop"
} Updating the
|
I think this is now resolved with the merge of https://github.com/terraform-providers/terraform-provider-github/pull/194. Please re-open if there is more to do here. |
Affected Resource(s)
Please list the resources as a list, for example:
Expected Behavior
In support of the more modern naming convention that GitHub is adopting for allowing the default branch to be
main
by default rather thanmaster
, I attempted to update my git repo management project to use the same convention.I expected the default_branch attribute of
github_repository
to allow setting this.Actual Behavior
The provider returned an error:
Limits
If this is a provider limitation with GitHub right now, and not able to be resolved immediately, I'd suggest this be marked as a pinned item to revisit in a few months after GitHub finishes these changes. This is part of the better inclusive language that GitHub is working to support and if the current provider is limited, would be good to pin to have as item to support once GitHub fixes it.
The text was updated successfully, but these errors were encountered: