Skip to content

Commit 1cb3b4d

Browse files
authored
Add has_discussions field to repository (#2589)
Fixes: #2586.
1 parent 0621dee commit 1cb3b4d

File tree

4 files changed

+29
-7
lines changed

4 files changed

+29
-7
lines changed

github/github-accessors.go

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

github/github-accessors_test.go

Lines changed: 10 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

github/github-stringify_test.go

Lines changed: 2 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

github/repos.go

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ type Repository struct {
8888
HasPages *bool `json:"has_pages,omitempty"`
8989
HasProjects *bool `json:"has_projects,omitempty"`
9090
HasDownloads *bool `json:"has_downloads,omitempty"`
91+
HasDiscussions *bool `json:"has_discussions,omitempty"`
9192
IsTemplate *bool `json:"is_template,omitempty"`
9293
LicenseTemplate *string `json:"license_template,omitempty"`
9394
GitignoreTemplate *string `json:"gitignore_template,omitempty"`
@@ -365,12 +366,13 @@ type createRepoRequest struct {
365366
Description *string `json:"description,omitempty"`
366367
Homepage *string `json:"homepage,omitempty"`
367368

368-
Private *bool `json:"private,omitempty"`
369-
Visibility *string `json:"visibility,omitempty"`
370-
HasIssues *bool `json:"has_issues,omitempty"`
371-
HasProjects *bool `json:"has_projects,omitempty"`
372-
HasWiki *bool `json:"has_wiki,omitempty"`
373-
IsTemplate *bool `json:"is_template,omitempty"`
369+
Private *bool `json:"private,omitempty"`
370+
Visibility *string `json:"visibility,omitempty"`
371+
HasIssues *bool `json:"has_issues,omitempty"`
372+
HasProjects *bool `json:"has_projects,omitempty"`
373+
HasWiki *bool `json:"has_wiki,omitempty"`
374+
HasDiscussions *bool `json:"has_discussions,omitempty"`
375+
IsTemplate *bool `json:"is_template,omitempty"`
374376

375377
// Creating an organization repository. Required for non-owners.
376378
TeamID *int64 `json:"team_id,omitempty"`
@@ -423,6 +425,7 @@ func (s *RepositoriesService) Create(ctx context.Context, org string, repo *Repo
423425
HasIssues: repo.HasIssues,
424426
HasProjects: repo.HasProjects,
425427
HasWiki: repo.HasWiki,
428+
HasDiscussions: repo.HasDiscussions,
426429
IsTemplate: repo.IsTemplate,
427430
TeamID: repo.TeamID,
428431
AutoInit: repo.AutoInit,

0 commit comments

Comments
 (0)