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

feat: add repository pages public attribute #1112

Closed
wants to merge 8 commits into from
Closed
Show file tree
Hide file tree
Changes from 7 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
6 changes: 6 additions & 0 deletions github/resource_github_repository.go
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,11 @@ func resourceGithubRepository() *schema.Resource {
Computed: true,
Description: "URL to the repository on the web.",
},
"public": {
Type: schema.TypeBool,
Optional: true,
Default: true,
},
"status": {
Type: schema.TypeString,
Computed: true,
Expand Down Expand Up @@ -875,6 +880,7 @@ func flattenPages(pages *github.Pages) []interface{} {
pagesMap := make(map[string]interface{})
pagesMap["source"] = []interface{}{sourceMap}
pagesMap["url"] = pages.GetURL()
pagesMap["public"] = pages.GetPublic()
pagesMap["status"] = pages.GetStatus()
pagesMap["cname"] = pages.GetCNAME()
pagesMap["custom_404"] = pages.GetCustom404()
Expand Down
2 changes: 2 additions & 0 deletions website/docs/r/repository.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,8 @@ The `pages` block supports the following:

* `cname` - (Optional) The custom domain for the repository. This can only be set after the repository has been created.

* `public` - (Optional) If set to `true` (default) the site is accessible to anyone on the internet. If set to `false`, the site will only be accessible to users who have at least `read` access to the repository. Note that setting this to `false` is only available for GitHub Enterprise Cloud repositories.

#### GitHub Pages Source ####

The `source` block supports the following:
Expand Down