Skip to content
Draft
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
1 change: 1 addition & 0 deletions alz/github/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ module "github" {
organization_name = var.github_organization_name
environments = local.environments
repository_name = local.resource_names.version_control_system_repository
repository_visibility = var.repository_visibility
use_template_repository = var.use_separate_repository_for_templates
repository_name_templates = local.resource_names.version_control_system_repository_templates
repository_files = local.repository_files
Expand Down
10 changes: 10 additions & 0 deletions alz/github/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,16 @@ variable "use_separate_repository_for_templates" {
default = true
}

variable "repository_visibility" {
description = "Can be public or private. If your organization is associated with an enterprise account using GitHub Enterprise Cloud or GitHub Enterprise Server 2.20+, visibility can also be internal. The visibility parameter overrides the private parameter."
type = string
default = "private"
validation {
condition = contains(["private", "public", "internal"], var.repository_visibility)
error_message = "The repository visibility must be either of (private|public|internal)"
}
}

variable "bootstrap_subscription_id" {
description = "Azure Subscription ID for the bootstrap resources (e.g. storage account, identities, etc). Leave empty to use the az login subscription"
type = string
Expand Down
2 changes: 1 addition & 1 deletion modules/github/repository_module.tf
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ resource "github_repository" "alz" {
name = var.repository_name
description = var.repository_name
auto_init = true
visibility = data.github_organization.alz.plan == local.free_plan ? "public" : "private"
visibility = var.repository_visibility
allow_update_branch = true
allow_merge_commit = false
allow_rebase_merge = false
Expand Down
2 changes: 1 addition & 1 deletion modules/github/repository_templates.tf
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ resource "github_repository" "alz_templates" {
name = var.repository_name_templates
description = var.repository_name_templates
auto_init = true
visibility = data.github_organization.alz.plan == local.free_plan ? "public" : "private"
visibility = var.repository_visibility
allow_update_branch = true
allow_merge_commit = false
allow_rebase_merge = false
Expand Down
4 changes: 4 additions & 0 deletions modules/github/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -91,3 +91,7 @@ variable "use_self_hosted_runners" {
variable "create_branch_policies" {
type = bool
}

variable "repository_visibility" {
type = string
}
Loading