From 8b72dcbac2c4287672a22435e36bbc27a869db5c Mon Sep 17 00:00:00 2001 From: Kerim Satirli Date: Wed, 18 Jan 2023 09:13:53 +0100 Subject: [PATCH] Fixes `update_on_create` for `var.files` (#33) * consider `overwrite_on_create` when managing repository files * linting --- .terraform.lock.hcl | 34 +++++++++++++++++----------------- README.md | 2 +- examples/files/main.tf | 10 ++++++---- variables.tf | 6 +++--- 4 files changed, 27 insertions(+), 25 deletions(-) diff --git a/.terraform.lock.hcl b/.terraform.lock.hcl index 34670f0..301a3a9 100644 --- a/.terraform.lock.hcl +++ b/.terraform.lock.hcl @@ -2,23 +2,23 @@ # Manual edits may be lost in future updates. provider "registry.terraform.io/integrations/github" { - version = "5.3.0" - constraints = ">= 5.3.0, < 6.0.0" + version = "5.15.0" + constraints = ">= 5.15.0, < 6.0.0" hashes = [ - "h1:pFsKVGjnvAUu9Scqkk3W0EdjEXtgkTz2qxKYMMA/Bww=", - "zh:1ad22c2d5b02f16ff6281e471be93d9e33f102020e7d88b2a86fd97b7f2c3728", - "zh:1d3968417f7cd87678d505afd12d8d753e692dd90c6ba0f52e7b150c69649eaf", - "zh:1fd5c610488671e7685ebd9b4afaf6fb86f5540f4a9df03a6ef4d449aec761c2", - "zh:2d494a769e8c5f9ac1cbb115117d4eba8dccf1f5524264ee010d67d92c43a639", - "zh:53642cbb984f9cb7a1f5a4a2bab274d11690411c8e0fa58e9a521588c15f6fc1", - "zh:5a62005caf307169feb457a89f53530221b04cd18ffa6862109ef1cf19972ec6", - "zh:64cbffbc2cea25892defc75e53c01bd0d3f51537b892869101fad5109c9ba80e", - "zh:653ed9b6f8b81ad6c0dd7428ac1cd6a90608db44d12d92c3e68ffb2da7abda4b", - "zh:6e197a456605392c501b662006a7c175c32cadabebe93671f7dc1d8e8c3b635b", - "zh:7bc207b8363f404f8b40f90329b04eb480ba09e7581408d7158edc4282daa86d", - "zh:80504cbf6f7214949ac3a43d652c8e8bf8059446174f30338f106bcc5f7b3070", - "zh:c8d2d65d9d89cb34bd63e6b2f48774469b9f8862e364e92c4f64db33930b60fb", - "zh:e2a81619918d92e16c461ea5e68ffec1b2860d1e80742018690a325c3b5da5db", - "zh:f0077fbaee5580650c9e09cc558620194478406998b1c4e875f91016ea543fc4", + "h1:65YheuuUvx6CFvgYVPCFvHrHw0f9ZewJSytv3WiERfs=", + "zh:08e219d4fdde18ba2e921404f294ce937489acfb254320cb86c988d24d2cf3bb", + "zh:0fc35695d1e76fcb8e0c91b483c63830a50cf826f401fa8d3891aa8ca78bae87", + "zh:4994f806763cc5340e450e3fb48e29dfc5bd8cf37f985d74aea045222461f4f0", + "zh:7633cd32918e6dcea2c3dcd3ce0340c4b8ed893c772fb72709f9fff6f1eefa58", + "zh:8298ae5fb2a7628ae50fffb7d2f9bc55e6e61cb0ccc5d9b8c7274ba100300c9f", + "zh:8b555d88a7ba7e87d7be9767a875803c9e227b6188cafdad66ebb831c7878ed3", + "zh:94fb0a01c3e0869887d2cb4ccc51e5670052922a60683578ca537422b96c0b91", + "zh:9e6e3b8ef87dbc96b338d57bcb1fd0a5760c4f9c842cab468b97d58ddd4c7808", + "zh:ad0c7fc84ba21c073de146681f2d07f3bf68dd034ad3bb6adbbfd58ce33cd1bf", + "zh:b0b98f13d700c215a61727c7d6860f442206df74d2db779435ad381100632d11", + "zh:b22b3105e599532bdb1733f015da4b08b7ee8d923b63338815e88c78abfeca4f", + "zh:b64708f3d663822ee280965441289070069b0faf985b3766173febc61372d95d", + "zh:bc89c1c75a70d0d18f51b923882a59630aa559b4c7acf8aa6e034eb3dfaa53b2", + "zh:c229c512b71befc33ceb8a7343f1ff92db1cfca5e03ee6293e5c109c11f29f8d", ] } diff --git a/README.md b/README.md index de25913..6413b72 100644 --- a/README.md +++ b/README.md @@ -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 |
list(object({
title = string,
key = string,
read_only = bool
}))
| `[]` | no | | description | Description of the Repository. | `string` | `null` | no | -| files | List of File Objects. |
list(object({
file = string,
content = string
}))
| `[]` | no | +| files | List of File Objects. |
list(object({
file = string,
content = string,
overwrite_on_create = string
}))
| `[]` | 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 | diff --git a/examples/files/main.tf b/examples/files/main.tf index 61dfc6c..c850af0 100644 --- a/examples/files/main.tf +++ b/examples/files/main.tf @@ -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 } ] } diff --git a/variables.tf b/variables.tf index f5887ba..a6d01bb 100644 --- a/variables.tf +++ b/variables.tf @@ -198,7 +198,6 @@ variable "repository_webhooks" { default = [] } - variable "deploy_keys" { type = list(object({ title = string, @@ -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."