diff --git a/github/data_source_github_repository.go b/github/data_source_github_repository.go index 065310ff58..e41631b348 100644 --- a/github/data_source_github_repository.go +++ b/github/data_source_github_repository.go @@ -37,6 +37,10 @@ func dataSourceGithubRepository() *schema.Resource { Type: schema.TypeBool, Computed: true, }, + "visibility": { + Type: schema.TypeString, + Computed: true, + }, "has_issues": { Type: schema.TypeBool, Computed: true, @@ -143,6 +147,7 @@ func dataSourceGithubRepositoryRead(d *schema.ResourceData, meta interface{}) er d.Set("description", repo.GetDescription()) d.Set("homepage_url", repo.GetHomepage()) d.Set("private", repo.GetPrivate()) + d.Set("visibility", repo.GetVisibility()) d.Set("has_issues", repo.GetHasIssues()) d.Set("has_wiki", repo.GetHasWiki()) d.Set("allow_merge_commit", repo.GetAllowMergeCommit()) diff --git a/github/data_source_github_repository_test.go b/github/data_source_github_repository_test.go index c7b426f168..22cb0e334e 100644 --- a/github/data_source_github_repository_test.go +++ b/github/data_source_github_repository_test.go @@ -77,6 +77,7 @@ func testRepoCheck() resource.TestCheckFunc { resource.TestCheckResourceAttr("data.github_repository.test", "id", "test-repo"), resource.TestCheckResourceAttr("data.github_repository.test", "name", "test-repo"), resource.TestCheckResourceAttr("data.github_repository.test", "private", "false"), + resource.TestCheckResourceAttr("data.github_repository.test", "visibility", "public"), resource.TestCheckResourceAttr("data.github_repository.test", "description", "Test description, used in GitHub Terraform provider acceptance test."), resource.TestCheckResourceAttr("data.github_repository.test", "homepage_url", "http://www.example.com"), resource.TestCheckResourceAttr("data.github_repository.test", "has_issues", "true"), diff --git a/website/docs/d/repository.html.markdown b/website/docs/d/repository.html.markdown index 99b1404d16..14247da86a 100644 --- a/website/docs/d/repository.html.markdown +++ b/website/docs/d/repository.html.markdown @@ -33,6 +33,8 @@ The following arguments are supported: * `private` - Whether the repository is private. +* `visibility` - Whether the repository is public, private or internal. + * `has_issues` - Whether the repository has GitHub Issues enabled. * `has_projects` - Whether the repository has the GitHub Projects enabled.