-
Notifications
You must be signed in to change notification settings - Fork 927
Open
Labels
Status: Up for grabsIssues that are ready to be worked on by anyoneIssues that are ready to be worked on by anyoneType: SupportAny questions, information, or general needs around the SDK or GitHub APIsAny questions, information, or general needs around the SDK or GitHub APIsr/branch
Description
Hello,
We are facing this error while trying to create a new branch for a new repository :
github_branch.branch: Creating...
Error: Error querying GitHub branch reference my-organization/first-repository (refs/heads/master): GET https://api.github.com/repos/my-organization/first-repository/git/refs/heads/master: 409 Git Repository is empty. []
on main.tf line 15, in resource "github_branch" "branch":
15: resource "github_branch" "branch" {
Terraform Version
Terraform v0.12.29
+ provider.github v2.9.2Affected Resource(s)
- github_branch
Terraform Configuration Files
provider "github" {
version = "~> 2.9"
token = "***"
organization = "my-organization"
}
resource "github_repository" "repository" {
name = "first-repository"
description = "This is the first repository"
private = true
delete_branch_on_merge = true
}
resource "github_branch" "branch" {
repository = github_repository.repository.name
branch = "main"
}Expected Behavior
Create the repository and the branch
Actual Behavior
The branch is not created because the repository is empty
Regards
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
Status: Up for grabsIssues that are ready to be worked on by anyoneIssues that are ready to be worked on by anyoneType: SupportAny questions, information, or general needs around the SDK or GitHub APIsAny questions, information, or general needs around the SDK or GitHub APIsr/branch
Type
Projects
Status
🔥 Backlog
Status
In Progress