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

feature: add archive_on_destroy argument to the github_repository resource #71

Merged
merged 2 commits into from
Sep 20, 2024
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
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@ No modules.
| <a name="input_allow_auto_merge"></a> [allow\_auto\_merge](#input\_allow\_auto\_merge) | Enable to allow auto-merging pull requests on the repository | `bool` | `false` | no |
| <a name="input_allow_rebase_merge"></a> [allow\_rebase\_merge](#input\_allow\_rebase\_merge) | To enable rebase merges on the repository | `bool` | `false` | no |
| <a name="input_allow_squash_merge"></a> [allow\_squash\_merge](#input\_allow\_squash\_merge) | To enable squash merges on the repository | `bool` | `false` | no |
| <a name="input_archive_on_destroy"></a> [archive\_on\_destroy](#input\_archive\_on\_destroy) | Set to true to archive the repository instead of deleting on destroy | `bool` | `false` | no |
| <a name="input_archived"></a> [archived](#input\_archived) | Specifies if the repository should be archived | `bool` | `false` | no |
| <a name="input_auto_init"></a> [auto\_init](#input\_auto\_init) | Disable to not produce an initial commit in the repository | `bool` | `true` | no |
| <a name="input_branches"></a> [branches](#input\_branches) | An optional map with GitHub branches to create | <pre>map(object({<br> source_branch = optional(string)<br> source_sha = optional(string)<br> use_branch_protection = optional(bool, true)<br><br> branch_protection = optional(object({<br> enforce_admins = optional(bool, false)<br> require_signed_commits = optional(bool, true)<br><br> required_checks = optional(object({<br> strict = optional(bool)<br> contexts = optional(list(string))<br> }))<br><br> restrict_pushes = optional(object({<br> blocks_creations = optional(bool)<br> push_allowances = optional(list(string))<br> }))<br><br> required_reviews = optional(object({<br> dismiss_stale_reviews = optional(bool, true)<br> dismissal_restrictions = optional(list(string))<br> required_approving_review_count = optional(number, 2)<br> require_code_owner_reviews = optional(bool, true)<br> }))<br> }), null)<br> }))</pre> | `{}` | no |
Expand Down
1 change: 1 addition & 0 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ resource "github_repository" "default" {
allow_auto_merge = var.allow_auto_merge
allow_rebase_merge = var.allow_rebase_merge
allow_squash_merge = var.allow_squash_merge
archive_on_destroy = var.archive_on_destroy
archived = var.archived
auto_init = var.auto_init
delete_branch_on_merge = var.delete_branch_on_merge
Expand Down
6 changes: 6 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,12 @@ variable "allow_squash_merge" {
description = "To enable squash merges on the repository"
}

variable "archive_on_destroy" {
type = bool
default = false
description = "Set to true to archive the repository instead of deleting on destroy"
}

variable "archived" {
type = bool
default = false
Expand Down