Skip to content
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

Add has_projects field #92

Merged
merged 1 commit into from
May 11, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 12 additions & 6 deletions github/resource_github_repository.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,14 @@ func resourceGithubRepository() *schema.Resource {
Type: schema.TypeBool,
Optional: true,
},
"has_projects": {
Type: schema.TypeBool,
Optional: true,
},
"has_downloads": {
Type: schema.TypeBool,
Optional: true,
},
"has_wiki": {
Type: schema.TypeBool,
Optional: true,
Expand All @@ -61,10 +69,6 @@ func resourceGithubRepository() *schema.Resource {
Optional: true,
Default: true,
},
"has_downloads": {
Type: schema.TypeBool,
Optional: true,
},
"auto_init": {
Type: schema.TypeBool,
Optional: true,
Expand Down Expand Up @@ -118,12 +122,13 @@ func resourceGithubRepositoryObject(d *schema.ResourceData) *github.Repository {
description := d.Get("description").(string)
homepageUrl := d.Get("homepage_url").(string)
private := d.Get("private").(bool)
hasDownloads := d.Get("has_downloads").(bool)
hasIssues := d.Get("has_issues").(bool)
hasProjects := d.Get("has_projects").(bool)
hasWiki := d.Get("has_wiki").(bool)
allowMergeCommit := d.Get("allow_merge_commit").(bool)
allowSquashMerge := d.Get("allow_squash_merge").(bool)
allowRebaseMerge := d.Get("allow_rebase_merge").(bool)
hasDownloads := d.Get("has_downloads").(bool)
autoInit := d.Get("auto_init").(bool)
licenseTemplate := d.Get("license_template").(string)
gitIgnoreTemplate := d.Get("gitignore_template").(string)
Expand All @@ -134,12 +139,13 @@ func resourceGithubRepositoryObject(d *schema.ResourceData) *github.Repository {
Description: &description,
Homepage: &homepageUrl,
Private: &private,
HasDownloads: &hasDownloads,
HasIssues: &hasIssues,
HasProjects: &hasProjects,
HasWiki: &hasWiki,
AllowMergeCommit: &allowMergeCommit,
AllowSquashMerge: &allowSquashMerge,
AllowRebaseMerge: &allowRebaseMerge,
HasDownloads: &hasDownloads,
AutoInit: &autoInit,
LicenseTemplate: &licenseTemplate,
GitignoreTemplate: &gitIgnoreTemplate,
Expand Down
5 changes: 4 additions & 1 deletion github/resource_github_repository_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ func TestAccGithubRepository_basic(t *testing.T) {
AllowSquashMerge: false,
AllowRebaseMerge: false,
HasDownloads: true,
HasProjects: false,
DefaultBranch: "master",
Archived: false,
}),
Expand All @@ -90,6 +91,7 @@ func TestAccGithubRepository_basic(t *testing.T) {
AllowSquashMerge: true,
AllowRebaseMerge: true,
DefaultBranch: "master",
HasProjects: false,
Archived: false,
}),
),
Expand Down Expand Up @@ -328,12 +330,13 @@ type testAccGithubRepositoryExpectedAttributes struct {
Description string
Homepage string
Private bool
HasDownloads bool
HasIssues bool
HasProjects bool
HasWiki bool
AllowMergeCommit bool
AllowSquashMerge bool
AllowRebaseMerge bool
HasDownloads bool
AutoInit bool
DefaultBranch string
LicenseTemplate string
Expand Down