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
8 changes: 8 additions & 0 deletions modules/private_repository/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ No resources.
| <a name="input_action_secrets"></a> [action\_secrets](#input\_action\_secrets) | An (Optional) map of GitHub Actions secrets to create for this repository. The key is the name of the secret and the value is the encrypted value. | `map(string)` | `{}` | no |
| <a name="input_advance_security"></a> [advance\_security](#input\_advance\_security) | Enables advance security for the repository. | `bool` | `true` | no |
| <a name="input_allow_auto_merge"></a> [allow\_auto\_merge](#input\_allow\_auto\_merge) | Allow auto-merging pull requests on the repository | `bool` | `true` | no |
| <a name="input_allow_merge_commit"></a> [allow\_merge\_commit](#input\_allow\_merge\_commit) | (Optional) Set to `false` to disable merge commits on the repository. | `bool` | `true` | no |
| <a name="input_allow_rebase_merge"></a> [allow\_rebase\_merge](#input\_allow\_rebase\_merge) | (Optional) Set to `false` to disable rebase merges on the repository. | `bool` | `true` | no |
| <a name="input_allow_squash_merge"></a> [allow\_squash\_merge](#input\_allow\_squash\_merge) | (Optional) Set to `false` to disable squash merges on the repository. | `bool` | `true` | no |
| <a name="input_codespace_secrets"></a> [codespace\_secrets](#input\_codespace\_secrets) | An (Optional) map of Github Codespace secrets to create for this repository. The key is the name of the secret and the value is the encrypted value. | `map(string)` | `{}` | no |
| <a name="input_default_branch"></a> [default\_branch](#input\_default\_branch) | The branch to set as the default branch for this repository. Defaults to "main" | `string` | `"main"` | no |
| <a name="input_delete_head_on_merge"></a> [delete\_head\_on\_merge](#input\_delete\_head\_on\_merge) | Sets the delete head on merge option for the repository. If true it will delete pull request branches automatically on merge. Defaults to true | `bool` | `true` | no |
Expand All @@ -36,12 +39,17 @@ No resources.
| <a name="input_has_ghas_license"></a> [has\_ghas\_license](#input\_has\_ghas\_license) | If the organization owning the repository has a GitHub Advanced Security license or not. Defaults to false. | `bool` | `false` | 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_merge_commit_message"></a> [merge\_commit\_message](#input\_merge\_commit\_message) | (Optional) Can be `PR_BODY`, `PR_TITLE`, or `BLANK` for a default merge commit message. Applicable only if allow\_merge\_commit is `true`. | `string` | `"PR_TITLE"` | no |
| <a name="input_merge_commit_title"></a> [merge\_commit\_title](#input\_merge\_commit\_title) | (Optional) Can be `PR_TITLE` or `MERGE_MESSAGE` for a default merge commit title. Applicable only if allow\_merge\_commit is `true`. | `string` | `"MERGE_MESSAGE"` | no |
| <a name="input_name"></a> [name](#input\_name) | The name of the repository to create/import. | `string` | n/a | yes |
| <a name="input_pages"></a> [pages](#input\_pages) | The (Optional) configuration for GitHub Pages for the repository | <pre>object({<br> source = optional(object({<br> branch = string<br> path = optional(string)<br> }))<br> build_type = optional(string)<br> cname = optional(string)<br> })</pre> | `null` | no |
| <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_repository_user_permissions"></a> [repository\_user\_permissions](#input\_repository\_user\_permissions) | A map where the keys are github usernames and the value is the permissions the user should have in the repository | `map(string)` | n/a | yes |
| <a name="input_requires_web_commit_signing"></a> [requires\_web\_commit\_signing](#input\_requires\_web\_commit\_signing) | If set commit signatures are required for commits to the organization. Defaults to `false`. | `bool` | `false` | no |
| <a name="input_rulesets"></a> [rulesets](#input\_rulesets) | n/a | <pre>map(object({<br> bypass_actors = optional(object({<br> repository_roles = optional(list(object({<br> role = string<br> always_bypass = optional(bool)<br> })))<br> teams = optional(list(object({<br> team = string<br> always_bypass = optional(bool)<br> })))<br> integrations = optional(list(object({<br> installation_id = number<br> always_bypass = optional(bool)<br> })))<br> organization_admins = optional(list(object({<br> user = string<br> always_bypass = optional(bool)<br> })))<br> }))<br> conditions = optional(object({<br> ref_name = object({<br> include = list(string)<br> exclude = list(string)<br> })<br> }))<br> rules = object({<br> branch_name_pattern = optional(object({<br> operator = string<br> pattern = string<br> name = optional(string)<br> negate = optional(bool)<br> }))<br> tag_name_pattern = optional(object({<br> operator = string<br> pattern = string<br> name = optional(string)<br> negate = optional(bool)<br> }))<br> commit_author_email_pattern = optional(object({<br> operator = string<br> pattern = string<br> name = optional(string)<br> negate = optional(bool)<br> }))<br> commit_message_pattern = optional(object({<br> operator = string<br> pattern = string<br> name = optional(string)<br> negate = optional(bool)<br> }))<br> committer_email_pattern = optional(object({<br> operator = string<br> pattern = string<br> name = optional(string)<br> negate = optional(bool)<br> }))<br> creation = optional(bool)<br> deletion = optional(bool)<br> update = optional(bool)<br> non_fast_forward = optional(bool)<br> required_linear_history = optional(bool)<br> required_signatures = optional(bool)<br> update_allows_fetch_and_merge = optional(bool)<br> pull_request = optional(object({<br> dismiss_stale_reviews_on_push = optional(bool)<br> require_code_owner_review = optional(bool)<br> require_last_push_approval = optional(bool)<br> required_approving_review_count = optional(number)<br> required_review_thread_resolution = optional(bool)<br> }))<br> required_status_checks = optional(object({<br> required_check = list(object({<br> context = string<br> integration_id = optional(number)<br> }))<br> strict_required_status_check_policy = optional(bool)<br> }))<br> required_deployment_environments = optional(list(string))<br> })<br> target = string<br> enforcement = string<br> }))</pre> | `{}` | no |
| <a name="input_squash_merge_commit_message"></a> [squash\_merge\_commit\_message](#input\_squash\_merge\_commit\_message) | (Optional) Can be `PR_BODY`, `COMMIT_MESSAGES`, or `BLANK` for a default squash merge commit message. Applicable only if allow\_squash\_merge is `true`. | `string` | `"PR_BODY"` | no |
| <a name="input_squash_merge_commit_title"></a> [squash\_merge\_commit\_title](#input\_squash\_merge\_commit\_title) | (Optional) Can be `PR_TITLE` or `COMMIT_OR_PR_TITLE` for a default squash merge commit title. Applicable only if allow\_squash\_merge is `true`. | `string` | `"PR_TITLE"` | 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 |

Expand Down
8 changes: 8 additions & 0 deletions modules/private_repository/repository.tf
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,15 @@ module "repository_base" {
protected_branches = var.protected_branches
delete_head_on_merge = var.delete_head_on_merge
allow_auto_merge = var.allow_auto_merge
allow_merge_commit = var.allow_merge_commit
allow_rebase_merge = var.allow_rebase_merge
allow_squash_merge = var.allow_squash_merge
squash_merge_commit_message = var.squash_merge_commit_message
squash_merge_commit_title = var.squash_merge_commit_title
merge_commit_message = var.merge_commit_message
merge_commit_title = var.merge_commit_title
requires_web_commit_signing = var.requires_web_commit_signing
pages = var.pages

secret_scanning = local.enable_secret_scanning
secret_scanning_on_push = local.enable_secret_scanning
Expand Down
55 changes: 55 additions & 0 deletions modules/private_repository/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,61 @@ variable "template_repository" {
default = null
}

variable "pages" {
description = "The (Optional) configuration for GitHub Pages for the repository"
type = object({
source = optional(object({
branch = string
path = optional(string)
}))
build_type = optional(string)
cname = optional(string)
})
default = null
}

variable "allow_squash_merge" {
description = "(Optional) Set to `false` to disable squash merges on the repository."
type = bool
default = true
}

variable "allow_rebase_merge" {
description = "(Optional) Set to `false` to disable rebase merges on the repository."
type = bool
default = true
}

variable "allow_merge_commit" {
description = " (Optional) Set to `false` to disable merge commits on the repository."
type = bool
default = true
}

variable "squash_merge_commit_title" {
description = " (Optional) Can be `PR_TITLE` or `COMMIT_OR_PR_TITLE` for a default squash merge commit title. Applicable only if allow_squash_merge is `true`."
type = string
default = "PR_TITLE"
}

variable "squash_merge_commit_message" {
description = "(Optional) Can be `PR_BODY`, `COMMIT_MESSAGES`, or `BLANK` for a default squash merge commit message. Applicable only if allow_squash_merge is `true`."
type = string
default = "PR_BODY"
}

variable "merge_commit_title" {
description = "(Optional) Can be `PR_TITLE` or `MERGE_MESSAGE` for a default merge commit title. Applicable only if allow_merge_commit is `true`."
type = string
default = "MERGE_MESSAGE"
}

variable "merge_commit_message" {
description = "(Optional) Can be `PR_BODY`, `PR_TITLE`, or `BLANK` for a default merge commit message. Applicable only if allow_merge_commit is `true`."
type = string
default = "PR_TITLE"
}

variable "license_template" {
description = "The (Optional) license template to use for the repository"
type = string
Expand Down
8 changes: 8 additions & 0 deletions modules/public_repository/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ No resources.
| <a name="input_action_secrets"></a> [action\_secrets](#input\_action\_secrets) | An (Optional) map of GitHub Actions secrets to create for this repository. The key is the name of the secret and the value is the encrypted value. | `map(string)` | `{}` | no |
| <a name="input_advance_security"></a> [advance\_security](#input\_advance\_security) | Enables advance security for the repository. If repository is public `advance_security` is enabled by default and cannot be changed. | `bool` | `true` | no |
| <a name="input_allow_auto_merge"></a> [allow\_auto\_merge](#input\_allow\_auto\_merge) | Allow auto-merging pull requests on the repository | `bool` | `true` | no |
| <a name="input_allow_merge_commit"></a> [allow\_merge\_commit](#input\_allow\_merge\_commit) | (Optional) Set to `false` to disable merge commits on the repository. | `bool` | `true` | no |
| <a name="input_allow_rebase_merge"></a> [allow\_rebase\_merge](#input\_allow\_rebase\_merge) | (Optional) Set to `false` to disable rebase merges on the repository. | `bool` | `true` | no |
| <a name="input_allow_squash_merge"></a> [allow\_squash\_merge](#input\_allow\_squash\_merge) | (Optional) Set to `false` to disable squash merges on the repository. | `bool` | `true` | no |
| <a name="input_codespace_secrets"></a> [codespace\_secrets](#input\_codespace\_secrets) | An (Optional) map of GitHub Codespace secrets to create for this repository. The key is the name of the secret and the value is the encrypted value. | `map(string)` | `{}` | no |
| <a name="input_default_branch"></a> [default\_branch](#input\_default\_branch) | The branch to set as the default branch for this repository. Defaults to "main" | `string` | `"main"` | no |
| <a name="input_delete_head_on_merge"></a> [delete\_head\_on\_merge](#input\_delete\_head\_on\_merge) | Sets the delete head on merge option for the repository. If true it will delete pull request branches automatically on merge. Defaults to true | `bool` | `true` | no |
Expand All @@ -35,12 +38,17 @@ No resources.
| <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_merge_commit_message"></a> [merge\_commit\_message](#input\_merge\_commit\_message) | (Optional) Can be `PR_BODY`, `PR_TITLE`, or `BLANK` for a default merge commit message. Applicable only if allow\_merge\_commit is `true`. | `string` | `"PR_TITLE"` | no |
| <a name="input_merge_commit_title"></a> [merge\_commit\_title](#input\_merge\_commit\_title) | (Optional) Can be `PR_TITLE` or `MERGE_MESSAGE` for a default merge commit title. Applicable only if allow\_merge\_commit is `true`. | `string` | `"MERGE_MESSAGE"` | no |
| <a name="input_name"></a> [name](#input\_name) | The name of the repository to create/import. | `string` | n/a | yes |
| <a name="input_pages"></a> [pages](#input\_pages) | The (Optional) configuration for GitHub Pages for the repository | <pre>object({<br> source = optional(object({<br> branch = string<br> path = optional(string)<br> }))<br> build_type = optional(string)<br> cname = optional(string)<br> })</pre> | `null` | no |
| <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_repository_user_permissions"></a> [repository\_user\_permissions](#input\_repository\_user\_permissions) | A map where the keys are github usernames and the value is the permissions the user should have in the repository | `map(string)` | n/a | yes |
| <a name="input_requires_web_commit_signing"></a> [requires\_web\_commit\_signing](#input\_requires\_web\_commit\_signing) | If set commit signatures are required for commits to the organization. Defaults to `false`. | `bool` | `false` | no |
| <a name="input_rulesets"></a> [rulesets](#input\_rulesets) | n/a | <pre>map(object({<br> bypass_actors = optional(object({<br> repository_roles = optional(list(object({<br> role = string<br> always_bypass = optional(bool)<br> })))<br> teams = optional(list(object({<br> team = string<br> always_bypass = optional(bool)<br> })))<br> integrations = optional(list(object({<br> installation_id = number<br> always_bypass = optional(bool)<br> })))<br> organization_admins = optional(list(object({<br> user = string<br> always_bypass = optional(bool)<br> })))<br> }))<br> conditions = optional(object({<br> ref_name = object({<br> include = list(string)<br> exclude = list(string)<br> })<br> }))<br> rules = object({<br> branch_name_pattern = optional(object({<br> operator = string<br> pattern = string<br> name = optional(string)<br> negate = optional(bool)<br> }))<br> tag_name_pattern = optional(object({<br> operator = string<br> pattern = string<br> name = optional(string)<br> negate = optional(bool)<br> }))<br> commit_author_email_pattern = optional(object({<br> operator = string<br> pattern = string<br> name = optional(string)<br> negate = optional(bool)<br> }))<br> commit_message_pattern = optional(object({<br> operator = string<br> pattern = string<br> name = optional(string)<br> negate = optional(bool)<br> }))<br> committer_email_pattern = optional(object({<br> operator = string<br> pattern = string<br> name = optional(string)<br> negate = optional(bool)<br> }))<br> creation = optional(bool)<br> deletion = optional(bool)<br> update = optional(bool)<br> non_fast_forward = optional(bool)<br> required_linear_history = optional(bool)<br> required_signatures = optional(bool)<br> update_allows_fetch_and_merge = optional(bool)<br> pull_request = optional(object({<br> dismiss_stale_reviews_on_push = optional(bool)<br> require_code_owner_review = optional(bool)<br> require_last_push_approval = optional(bool)<br> required_approving_review_count = optional(number)<br> required_review_thread_resolution = optional(bool)<br> }))<br> required_status_checks = optional(object({<br> required_check = list(object({<br> context = string<br> integration_id = optional(number)<br> }))<br> strict_required_status_check_policy = optional(bool)<br> }))<br> required_deployment_environments = optional(list(string))<br> })<br> target = string<br> enforcement = string<br> }))</pre> | `{}` | no |
| <a name="input_squash_merge_commit_message"></a> [squash\_merge\_commit\_message](#input\_squash\_merge\_commit\_message) | (Optional) Can be `PR_BODY`, `COMMIT_MESSAGES`, or `BLANK` for a default squash merge commit message. Applicable only if allow\_squash\_merge is `true`. | `string` | `"PR_BODY"` | no |
| <a name="input_squash_merge_commit_title"></a> [squash\_merge\_commit\_title](#input\_squash\_merge\_commit\_title) | (Optional) Can be `PR_TITLE` or `COMMIT_OR_PR_TITLE` for a default squash merge commit title. Applicable only if allow\_squash\_merge is `true`. | `string` | `"PR_TITLE"` | 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 |

Expand Down
Loading