Skip to content
Merged
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
3 changes: 2 additions & 1 deletion modules/private_repository/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,11 @@ No resources.
| <a name="input_description"></a> [description](#input\_description) | The description to give to the repository. Defaults to `""` | `string` | `""` | no |
| <a name="input_environments"></a> [environments](#input\_environments) | Environments to create for the repository. | <pre>map(object({<br> action_secrets = optional(map(string))<br> }))</pre> | `{}` | no |
| <a name="input_homepage"></a> [homepage](#input\_homepage) | The homepage for the repository | `string` | `""` | no |
| <a name="input_license_template"></a> [license\_template](#input\_license\_template) | The (Optional) license template to use for the repository | `string` | `null` | no |
| <a name="input_name"></a> [name](#input\_name) | The name of the repository to create/import. | `string` | n/a | yes |
| <a name="input_protected_branches"></a> [protected\_branches](#input\_protected\_branches) | A list of ref names or patterns that should be protected. Defaults `["main"]` | `list(string)` | <pre>[<br> "main"<br>]</pre> | no |
| <a name="input_repository_team_permissions"></a> [repository\_team\_permissions](#input\_repository\_team\_permissions) | A map where the keys are github team slugs and the value is the permissions the team should have in the repository | `map(string)` | n/a | yes |
| <a name="input_template_repository"></a> [template\_repository](#input\_template\_repository) | A list of template repositories to use for the repository | <pre>object({<br> owner = string<br> repository = string<br> include_all_branches = bool<br> })</pre> | `null` | no |
| <a name="input_template_repository"></a> [template\_repository](#input\_template\_repository) | A (Optional) list of template repositories to use for the repository | <pre>object({<br> owner = string<br> repository = string<br> include_all_branches = bool<br> })</pre> | `null` | no |
| <a name="input_topics"></a> [topics](#input\_topics) | The topics to apply to the repository | `list(string)` | `[]` | no |

## Outputs
Expand Down
1 change: 1 addition & 0 deletions modules/private_repository/repository.tf
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,5 @@ module "repository_base" {
environments = var.environments

template_repository = var.template_repository
license_template = var.license_template
}
8 changes: 7 additions & 1 deletion modules/private_repository/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -89,11 +89,17 @@ variable "environments" {
}

variable "template_repository" {
description = "A list of template repositories to use for the repository"
description = "A (Optional) list of template repositories to use for the repository"
type = object({
owner = string
repository = string
include_all_branches = bool
})
default = null
}

variable "license_template" {
description = "The (Optional) license template to use for the repository"
type = string
default = null
}
3 changes: 2 additions & 1 deletion modules/public_repository/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,11 @@ No resources.
| <a name="input_description"></a> [description](#input\_description) | The description to give to the repository. Defaults to `""` | `string` | `""` | no |
| <a name="input_environments"></a> [environments](#input\_environments) | Environments to create for the repository. | <pre>map(object({<br> action_secrets = optional(map(string))<br> }))</pre> | `{}` | no |
| <a name="input_homepage"></a> [homepage](#input\_homepage) | The homepage for the repository | `string` | `""` | no |
| <a name="input_license_template"></a> [license\_template](#input\_license\_template) | The (Optional) license template to apply to the repository | `string` | `null` | no |
| <a name="input_name"></a> [name](#input\_name) | The name of the repository to create/import. | `string` | n/a | yes |
| <a name="input_protected_branches"></a> [protected\_branches](#input\_protected\_branches) | A list of ref names or patterns that should be protected. Defaults `["main"]` | `list(string)` | <pre>[<br> "main"<br>]</pre> | no |
| <a name="input_repository_team_permissions"></a> [repository\_team\_permissions](#input\_repository\_team\_permissions) | A map where the keys are github team slugs and the value is the permissions the team should have in the repository | `map(string)` | n/a | yes |
| <a name="input_template_repository"></a> [template\_repository](#input\_template\_repository) | A list of template repositories to use for the repository | <pre>object({<br> owner = string<br> repository = string<br> include_all_branches = bool<br> })</pre> | `null` | no |
| <a name="input_template_repository"></a> [template\_repository](#input\_template\_repository) | A (Optional) list of template repositories to use for the repository | <pre>object({<br> owner = string<br> repository = string<br> include_all_branches = bool<br> })</pre> | `null` | no |
| <a name="input_topics"></a> [topics](#input\_topics) | The topics to apply to the repository | `list(string)` | `[]` | no |

## Outputs
Expand Down
1 change: 1 addition & 0 deletions modules/public_repository/repository.tf
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,5 @@ module "repository_base" {
environments = var.environments

template_repository = var.template_repository
license_template = var.license_template
}
8 changes: 7 additions & 1 deletion modules/public_repository/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -89,11 +89,17 @@ variable "environments" {
}

variable "template_repository" {
description = "A list of template repositories to use for the repository"
description = "A (Optional) list of template repositories to use for the repository"
type = object({
owner = string
repository = string
include_all_branches = bool
})
default = null
}

variable "license_template" {
description = "The (Optional) license template to apply to the repository"
type = string
default = null
}
3 changes: 2 additions & 1 deletion modules/repository_base/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,13 @@ No modules.
| <a name="input_has_vulnerability_alerts"></a> [has\_vulnerability\_alerts](#input\_has\_vulnerability\_alerts) | Enables security alerts for vulnerable dependencies for the repository | `bool` | `true` | no |
| <a name="input_has_wiki"></a> [has\_wiki](#input\_has\_wiki) | Enables Github Wiki for the repository | `bool` | `true` | no |
| <a name="input_homepage"></a> [homepage](#input\_homepage) | The homepage for the repository | `string` | `""` | no |
| <a name="input_license_template"></a> [license\_template](#input\_license\_template) | The (Optional) license template to use for the repository | `string` | `null` | no |
| <a name="input_name"></a> [name](#input\_name) | The name of the repository to create/import. | `string` | n/a | yes |
| <a name="input_protected_branches"></a> [protected\_branches](#input\_protected\_branches) | A list of ref names or patterns that should be protected. Setting to `[]` means no protection. Defaults `["~DEFAULT_BRANCH"]` | `list(string)` | <pre>[<br> "~DEFAULT_BRANCH"<br>]</pre> | no |
| <a name="input_repository_team_permissions"></a> [repository\_team\_permissions](#input\_repository\_team\_permissions) | A map where the keys are github team slugs and the value is the permissions the team should have in the repository | `map(string)` | n/a | yes |
| <a name="input_secret_scanning"></a> [secret\_scanning](#input\_secret\_scanning) | Enables secret scanning for the repository. If repository is private `advance_security` must also be enabled. | `bool` | `true` | no |
| <a name="input_secret_scanning_on_push"></a> [secret\_scanning\_on\_push](#input\_secret\_scanning\_on\_push) | Enables secret scanning push protection for the repository. If repository is private `advance_security` must also be enabled. | `bool` | `true` | no |
| <a name="input_template_repository"></a> [template\_repository](#input\_template\_repository) | A list of template repositories to use for the repository | <pre>object({<br> owner = string<br> repository = string<br> include_all_branches = bool<br> })</pre> | `null` | no |
| <a name="input_template_repository"></a> [template\_repository](#input\_template\_repository) | A (Optional) list of template repositories to use for the repository | <pre>object({<br> owner = string<br> repository = string<br> include_all_branches = bool<br> })</pre> | `null` | no |
| <a name="input_topics"></a> [topics](#input\_topics) | The topics to apply to the repository | `list(string)` | `[]` | no |
| <a name="input_visibility"></a> [visibility](#input\_visibility) | Sets the visibility property of a repository. Defaults to "private" | `string` | `"private"` | no |

Expand Down
2 changes: 2 additions & 0 deletions modules/repository_base/repository.tf
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ resource "github_repository" "repository" {
homepage_url = var.homepage
delete_branch_on_merge = var.delete_head_on_merge
allow_auto_merge = var.allow_auto_merge
license_template = var.license_template


# A hacky way of getting around the 422 errors received from github api
dynamic "security_and_analysis" {
Expand Down
8 changes: 7 additions & 1 deletion modules/repository_base/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -143,11 +143,17 @@ variable "environments" {
}

variable "template_repository" {
description = "A list of template repositories to use for the repository"
description = "A (Optional) list of template repositories to use for the repository"
type = object({
owner = string
repository = string
include_all_branches = bool
})
default = null
}

variable "license_template" {
description = "The (Optional) license template to use for the repository"
type = string
default = null
}
4 changes: 2 additions & 2 deletions modules/repository_set/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ No resources.
| Name | Description | Type | Default | Required |
|------|-------------|------|---------|:--------:|
| <a name="input_default_repository_team_permissions"></a> [default\_repository\_team\_permissions](#input\_default\_repository\_team\_permissions) | A map where the keys are github team slugs and the value is the permissions the team should have by default for every repository. If an entry exists in `repository_team_permissions_override` for a repository then that will take precedence over this default. | `map(string)` | n/a | yes |
| <a name="input_private_repositories"></a> [private\_repositories](#input\_private\_repositories) | A map of private repositories where the key is the repository name and the value is the configuration | <pre>map(object({<br> description = string<br> default_branch = string<br> repository_team_permissions_override = map(string)<br> protected_branches = list(string)<br> advance_security = bool<br> has_vulnerability_alerts = bool<br> topics = list(string)<br> homepage = string<br> delete_head_on_merge = bool<br> allow_auto_merge = bool<br> dependabot_security_updates = bool<br> action_secrets = optional(map(string))<br> codespace_secrets = optional(map(string))<br> dependabot_secrets = optional(map(string))<br> environments = optional(map(object({<br> action_secrets = optional(map(string))<br> })))<br> template_repository = optional(object({<br> owner = string<br> repository = string<br> include_all_branches = bool<br> }))<br> }))</pre> | n/a | yes |
| <a name="input_public_repositories"></a> [public\_repositories](#input\_public\_repositories) | A map of public repositories where the key is the repository name and the value is the configuration | <pre>map(object({<br> description = string<br> default_branch = string<br> repository_team_permissions_override = map(string)<br> protected_branches = list(string)<br> advance_security = bool<br> topics = list(string)<br> homepage = string<br> delete_head_on_merge = bool<br> allow_auto_merge = bool<br> dependabot_security_updates = bool<br> action_secrets = optional(map(string))<br> codespace_secrets = optional(map(string))<br> dependabot_secrets = optional(map(string))<br> environments = optional(map(object({<br> action_secrets = optional(map(string))<br> })))<br> template_repository = optional(object({<br> owner = string<br> repository = string<br> include_all_branches = bool<br> }))<br> }))</pre> | n/a | yes |
| <a name="input_private_repositories"></a> [private\_repositories](#input\_private\_repositories) | A map of private repositories where the key is the repository name and the value is the configuration | <pre>map(object({<br> description = string<br> default_branch = string<br> repository_team_permissions_override = map(string)<br> protected_branches = list(string)<br> advance_security = bool<br> has_vulnerability_alerts = bool<br> topics = list(string)<br> homepage = string<br> delete_head_on_merge = bool<br> allow_auto_merge = bool<br> dependabot_security_updates = bool<br> action_secrets = optional(map(string))<br> codespace_secrets = optional(map(string))<br> dependabot_secrets = optional(map(string))<br> environments = optional(map(object({<br> action_secrets = optional(map(string))<br> })))<br> template_repository = optional(object({<br> owner = string<br> repository = string<br> include_all_branches = bool<br> }))<br> license_template = optional(string)<br> }))</pre> | n/a | yes |
| <a name="input_public_repositories"></a> [public\_repositories](#input\_public\_repositories) | A map of public repositories where the key is the repository name and the value is the configuration | <pre>map(object({<br> description = string<br> default_branch = string<br> repository_team_permissions_override = map(string)<br> protected_branches = list(string)<br> advance_security = bool<br> topics = list(string)<br> homepage = string<br> delete_head_on_merge = bool<br> allow_auto_merge = bool<br> dependabot_security_updates = bool<br> action_secrets = optional(map(string))<br> codespace_secrets = optional(map(string))<br> dependabot_secrets = optional(map(string))<br> environments = optional(map(object({<br> action_secrets = optional(map(string))<br> })))<br> template_repository = optional(object({<br> owner = string<br> repository = string<br> include_all_branches = bool<br> }))<br> license_template = optional(string)<br> }))</pre> | n/a | yes |

## Outputs

Expand Down
2 changes: 2 additions & 0 deletions modules/repository_set/repositories.tf
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ module "public_repositories" {
dependabot_secrets = each.value.dependabot_secrets
environments = each.value.environments
template_repository = each.value.template_repository
license_template = each.value.license_template
}

module "private_repositories" {
Expand All @@ -42,4 +43,5 @@ module "private_repositories" {
dependabot_secrets = each.value.dependabot_secrets
environments = each.value.environments
template_repository = each.value.template_repository
license_template = each.value.license_template
}
2 changes: 2 additions & 0 deletions modules/repository_set/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ variable "private_repositories" {
repository = string
include_all_branches = bool
}))
license_template = optional(string)
}))
description = "A map of private repositories where the key is the repository name and the value is the configuration"
}
Expand Down Expand Up @@ -49,6 +50,7 @@ variable "public_repositories" {
repository = string
include_all_branches = bool
}))
license_template = optional(string)
}))
description = "A map of public repositories where the key is the repository name and the value is the configuration"
}
Expand Down