Skip to content

Allow Setting the github_repository.default_branch on creation to any designated value #513

@sheldonhull

Description

@sheldonhull

Affected Resource(s)

Please list the resources as a list, for example:

  • github_repository.default_branch

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 than master, 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:

Error: Cannot set the default branch on a new repository to something other than 'master'.

  on main.tf line 5, in resource "github_repository" "repo":
   5: resource "github_repository" "repo" {

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions