diff --git a/README.adoc b/README.adoc index 32ec400c..1a96a4c3 100644 --- a/README.adoc +++ b/README.adoc @@ -20,11 +20,11 @@ image:https://img.shields.io/badge/tf-%3E%3D0.12.9-blue.svg[Terraform Version] [.lead] A Terraform module that acts as a wrapper around the Terraform https://www.terraform.io/docs/providers/github/index.html[GitHub provider] -and offers a more convenient and tested way to provision and manage GitHub Repositories within your GitHub organization. following best practices. +and offers a more convenient and tested way to provision and manage GitHub Repositories within your GitHub organization following best practices. [NOTE] ==== -This resource cannot currently be used to manage personal repositories, outside of organizations due to limitations of the Terraform https://www.terraform.io/docs/providers/github/index.html[GitHub provider]. +This module cannot currently be used to manage personal repositories, outside of organizations due to limitations of the Terraform https://www.terraform.io/docs/providers/github/index.html[GitHub provider]. ==== [TIP] @@ -33,7 +33,7 @@ This Module uses `For, For-Each and Dynamic Nested Blocks` that were introduced A common problem in Terraform configurations for versions 0.11 and earlier is dealing with situations where the number of values or resources is decided by a dynamic expression rather than a fixed count. -Using `For, For-Each and Dynamic Nested Blocks` you can now dynamically add and remove items from and to Lists without +You can now dynamically add and remove items from and to Lists without the necessity to render the whole list of resources again. Terraform will only add and remove the items you want it to. ==== diff --git a/examples/private-repository-with-team/variables.tf b/examples/private-repository-with-team/variables.tf index 4169d302..259c824a 100644 --- a/examples/private-repository-with-team/variables.tf +++ b/examples/private-repository-with-team/variables.tf @@ -7,5 +7,5 @@ variable "github_token" { variable "github_organization" { type = string description = "Github organization used to deploy this module into. Typically, we set this using variables on the command line to set the value inside our CI environment. https://www.terraform.io/docs/configuration/variables.html#variables-on-the-command-line" - default = "" + default = null } diff --git a/examples/public-repository-complete-example/variables.tf b/examples/public-repository-complete-example/variables.tf index 4169d302..259c824a 100644 --- a/examples/public-repository-complete-example/variables.tf +++ b/examples/public-repository-complete-example/variables.tf @@ -7,5 +7,5 @@ variable "github_token" { variable "github_organization" { type = string description = "Github organization used to deploy this module into. Typically, we set this using variables on the command line to set the value inside our CI environment. https://www.terraform.io/docs/configuration/variables.html#variables-on-the-command-line" - default = "" + default = null } diff --git a/examples/public-repository-with-collaborators/variables.tf b/examples/public-repository-with-collaborators/variables.tf index 4169d302..259c824a 100644 --- a/examples/public-repository-with-collaborators/variables.tf +++ b/examples/public-repository-with-collaborators/variables.tf @@ -7,5 +7,5 @@ variable "github_token" { variable "github_organization" { type = string description = "Github organization used to deploy this module into. Typically, we set this using variables on the command line to set the value inside our CI environment. https://www.terraform.io/docs/configuration/variables.html#variables-on-the-command-line" - default = "" + default = null } diff --git a/examples/public-repository/variables.tf b/examples/public-repository/variables.tf index 4169d302..259c824a 100644 --- a/examples/public-repository/variables.tf +++ b/examples/public-repository/variables.tf @@ -7,5 +7,5 @@ variable "github_token" { variable "github_organization" { type = string description = "Github organization used to deploy this module into. Typically, we set this using variables on the command line to set the value inside our CI environment. https://www.terraform.io/docs/configuration/variables.html#variables-on-the-command-line" - default = "" + default = null } diff --git a/outputs.tf b/outputs.tf index 88159f8a..29e1907c 100644 --- a/outputs.tf +++ b/outputs.tf @@ -14,10 +14,10 @@ output "git_clone_url" { value = github_repository.repository.git_clone_url } -output "collaborator_invitation_id" { - value = { for k, v in github_repository_collaborator.collaborator : k => v.invitation_id } +output "collaborators" { + value = github_repository_collaborator.collaborator } -output "project_url" { - value = { for k, v in github_repository_project.repository_project : k => v.url } +output "projects" { + value = github_repository_project.repository_project } diff --git a/test/github_repository_test.go b/test/github_repository_test.go index 7346fef8..8f167432 100644 --- a/test/github_repository_test.go +++ b/test/github_repository_test.go @@ -12,6 +12,10 @@ func init() { githubOrganization = os.Getenv("GITHUB_ORGANIZATION") githubToken = os.Getenv("GITHUB_TOKEN") + if githubOrganization == "" { + panic("Please set a github organization using the GITHUB_ORGANIZATION environment variable.") + } + if githubToken == "" { panic("Please set a github token using the GITHUB_TOKEN environment variable.") } diff --git a/variables.tf b/variables.tf index 8058835d..e97d4d99 100644 --- a/variables.tf +++ b/variables.tf @@ -17,14 +17,14 @@ variable "homepage_url" { variable "private" { type = bool - description = "Set to true to create a private repository." - default = false + description = "Set to false to create a public repository." + default = true } variable "has_issues" { type = bool description = "Set to true to enable the GitHub Issues features on the repository." - default = true + default = false } variable "has_projects" { @@ -41,20 +41,20 @@ variable "has_wiki" { variable "allow_merge_commit" { type = bool - description = "Set to false to disable merge commits on the repository." - default = true + description = "Set to true to enable merge commits on the repository." + default = false } variable "allow_squash_merge" { type = bool - description = "Set to false to disable squash merges on the repository." - default = true + description = "Set to true to enable squash merges on the repository." + default = false } variable "allow_rebase_merge" { type = bool - description = "Set to false to disable rebase merges on the repository." - default = true + description = "Set to true to enable rebase merges on the repository." + default = false } variable "has_downloads" { @@ -66,7 +66,7 @@ variable "has_downloads" { variable "auto_init" { type = bool description = "Wether or not to produce an initial commit in the repository." - default = true + default = false } variable "gitignore_template" {