Skip to content

Commit

Permalink
Fixes update_on_create for var.files (ksatirli#33)
Browse files Browse the repository at this point in the history
* consider `overwrite_on_create` when managing repository files

* linting
  • Loading branch information
ksatirli authored Jan 18, 2023
1 parent 846b53c commit 8b72dcb
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 25 deletions.
34 changes: 17 additions & 17 deletions .terraform.lock.hcl

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ Additional usage examples are available in the `examples` directory via [GitHub]
| delete_branch_on_merge | Toggle to automatically delete merged Branches for the Repository. | `bool` | `false` | no |
| deploy_keys | List of Deploy Key Objects | <pre>list(object({<br> title = string,<br> key = string,<br> read_only = bool<br> }))</pre> | `[]` | no |
| description | Description of the Repository. | `string` | `null` | no |
| files | List of File Objects. | <pre>list(object({<br> file = string,<br> content = string<br> }))</pre> | `[]` | no |
| files | List of File Objects. | <pre>list(object({<br> file = string,<br> content = string,<br> overwrite_on_create = string<br> }))</pre> | `[]` | no |
| gitignore_template | Template to use for initial `.gitignore` file for the Repository. | `string` | `null` | no |
| has_downloads | Toggle to enable (deprecated) GitHub Downloads for the Repository. | `bool` | `false` | no |
| has_issues | Toggle to enable GitHub Issues for the Repository. | `bool` | `true` | no |
Expand Down
10 changes: 6 additions & 4 deletions examples/files/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,13 @@ module "files_example" {

files = [
{
file = ".gitignore",
content = file("../../.gitignore")
file = ".gitignore",
content = file("../../.gitignore")
overwrite_on_create = true
}, {
file = "LICENSE",
content = file("../../LICENSE")
file = "LICENSE",
content = file("../../LICENSE")
overwrite_on_create = true
}
]
}
6 changes: 3 additions & 3 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,6 @@ variable "repository_webhooks" {
default = []
}


variable "deploy_keys" {
type = list(object({
title = string,
Expand Down Expand Up @@ -255,8 +254,9 @@ variable "projects" {
variable "files" {
# `files.{branch,commit_author,commit_email,commit_message}` are optional and omitted when not set
type = list(object({
file = string,
content = string
file = string,
content = string,
overwrite_on_create = string
}))

description = "List of File Objects."
Expand Down

0 comments on commit 8b72dcb

Please sign in to comment.