Skip to content

Commit 52550f0

Browse files
committed
fix private repo creation in case of ignore templates
1 parent a6710ec commit 52550f0

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

pkg/cmd/repo/create/http.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ type repoCreateInput struct {
1919

2020
OwnerID string `json:"ownerId,omitempty"`
2121
TeamID string `json:"teamId,omitempty"`
22-
22+
Private bool `json:"private,omitempty"`
2323
HasIssuesEnabled bool `json:"hasIssuesEnabled"`
2424
HasWikiEnabled bool `json:"hasWikiEnabled"`
2525
GitIgnoreTemplate string `json:"gitignore_template,omitempty"`
@@ -116,6 +116,11 @@ func repoCreate(client *http.Client, hostname string, input repoCreateInput, tem
116116

117117
if input.GitIgnoreTemplate != "" || input.LicenseTemplate != "" {
118118
input.Visibility = strings.ToLower(input.Visibility)
119+
120+
if input.Visibility == "private" {
121+
input.Private = true
122+
}
123+
119124
body := &bytes.Buffer{}
120125
enc := json.NewEncoder(body)
121126
if err := enc.Encode(input); err != nil {

0 commit comments

Comments
 (0)