Skip to content

Commit

Permalink
Add visibility parameter to repository
Browse files Browse the repository at this point in the history
Adds the additional visibility parameter allowing for enterprise
accounts to set the repository to be only internally visible.

Resolves integrations#304
  • Loading branch information
patrickmarabeas committed May 1, 2020
1 parent 41376f1 commit 0692569
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions github/resource_github_repository.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,12 @@ func resourceGithubRepository() *schema.Resource {
Type: schema.TypeBool,
Optional: true,
},
"visibility": {
Type: schema.TypeBool,
Optional: true,
Default: "public",
ValidateFunc: validateValueFunc([]string{"public", "private", "internal"}),
},
"has_issues": {
Type: schema.TypeBool,
Optional: true,
Expand Down Expand Up @@ -179,6 +185,7 @@ func resourceGithubRepositoryObject(d *schema.ResourceData) *github.Repository {
Description: github.String(d.Get("description").(string)),
Homepage: github.String(d.Get("homepage_url").(string)),
Private: github.Bool(d.Get("private").(bool)),
Visibility: github.String(d.Get("visibility").(string)),
HasDownloads: github.Bool(d.Get("has_downloads").(bool)),
HasIssues: github.Bool(d.Get("has_issues").(bool)),
HasProjects: github.Bool(d.Get("has_projects").(bool)),
Expand Down Expand Up @@ -303,6 +310,7 @@ func resourceGithubRepositoryRead(d *schema.ResourceData, meta interface{}) erro
d.Set("description", repo.Description)
d.Set("homepage_url", repo.Homepage)
d.Set("private", repo.Private)
d.Set("visibility", repo.GetVisibility())
d.Set("has_issues", repo.HasIssues)
d.Set("has_projects", repo.HasProjects)
d.Set("has_wiki", repo.HasWiki)
Expand Down

0 comments on commit 0692569

Please sign in to comment.