From 6654ae7c91615a4f4fbbb31aec6686ffa9f51dd5 Mon Sep 17 00:00:00 2001 From: Tobias Lindberg Date: Fri, 28 Apr 2023 13:04:05 +0200 Subject: [PATCH 1/3] add support for allow_update_branch --- README.md | 6 ++++++ README.tfdoc.hcl | 8 ++++++++ main.tf | 2 ++ variables.tf | 6 ++++++ 4 files changed, 22 insertions(+) diff --git a/README.md b/README.md index eed6135..90a9d2c 100644 --- a/README.md +++ b/README.md @@ -173,6 +173,12 @@ See [variables.tf] and [examples/] for details and use-cases. Default is `false`. +- [**`allow_update_branch`**](#var-allow_update_branch): *(Optional `bool`)* + + Set to true to suggest updating pull request branches. + + Default is `false`. + - [**`allow_auto_merge`**](#var-allow_auto_merge): *(Optional `bool`)* Set to `true` to allow [auto-merging](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/incorporating-changes-from-a-pull-request/automatically-merging-a-pull-request) diff --git a/README.tfdoc.hcl b/README.tfdoc.hcl index 1f75765..b47d984 100644 --- a/README.tfdoc.hcl +++ b/README.tfdoc.hcl @@ -205,6 +205,14 @@ section { END } + variable "allow_update_branch" { + type = bool + default = false + description = <<-END + Set to true to suggest updating pull request branches. + END + } + variable "allow_auto_merge" { type = bool default = false diff --git a/main.tf b/main.tf index 587e1bb..bc1e83f 100644 --- a/main.tf +++ b/main.tf @@ -15,6 +15,7 @@ locals { allow_merge_commit = var.allow_merge_commit == null ? lookup(var.defaults, "allow_merge_commit", true) : var.allow_merge_commit allow_rebase_merge = var.allow_rebase_merge == null ? lookup(var.defaults, "allow_rebase_merge", false) : var.allow_rebase_merge allow_squash_merge = var.allow_squash_merge == null ? lookup(var.defaults, "allow_squash_merge", false) : var.allow_squash_merge + allow_update_branch = var.allow_update_branch == null ? lookup(var.defaults, "allow_update_branch", false) : var.allow_update_branch allow_auto_merge = var.allow_auto_merge == null ? lookup(var.defaults, "allow_auto_merge", false) : var.allow_auto_merge delete_branch_on_merge = var.delete_branch_on_merge == null ? lookup(var.defaults, "delete_branch_on_merge", true) : var.delete_branch_on_merge is_template = var.is_template == null ? lookup(var.defaults, "is_template", false) : var.is_template @@ -99,6 +100,7 @@ resource "github_repository" "repository" { allow_merge_commit = local.allow_merge_commit allow_rebase_merge = local.allow_rebase_merge allow_squash_merge = local.allow_squash_merge + allow_update_branch = local.allow_update_branch allow_auto_merge = local.allow_auto_merge delete_branch_on_merge = local.delete_branch_on_merge is_template = local.is_template diff --git a/variables.tf b/variables.tf index 7599034..51edf0e 100644 --- a/variables.tf +++ b/variables.tf @@ -90,6 +90,12 @@ variable "allow_rebase_merge" { default = null } +variable "allow_update_branch" { + description = "(Optional) Set to true to suggest updating pull request branches. (Default: false)" + type = bool + default = null +} + variable "allow_auto_merge" { description = "(Optional) Set to true to allow auto-merging pull requests on the repository. If enabled for a pull request, the pull request will merge automatically when all required reviews are met and status checks have passed. (Default: false)" type = bool From 737ec846557a2db253cfa601083030e281a93cef Mon Sep 17 00:00:00 2001 From: Tobias Lindberg Date: Fri, 28 Apr 2023 13:13:12 +0200 Subject: [PATCH 2/3] updating readme regarding allow_update_branch --- README.md | 2 +- README.tfdoc.hcl | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 90a9d2c..56bb75b 100644 --- a/README.md +++ b/README.md @@ -175,7 +175,7 @@ See [variables.tf] and [examples/] for details and use-cases. - [**`allow_update_branch`**](#var-allow_update_branch): *(Optional `bool`)* - Set to true to suggest updating pull request branches. + Set to `true` to suggest updating pull request branches. Default is `false`. diff --git a/README.tfdoc.hcl b/README.tfdoc.hcl index b47d984..81f4f7e 100644 --- a/README.tfdoc.hcl +++ b/README.tfdoc.hcl @@ -209,7 +209,7 @@ section { type = bool default = false description = <<-END - Set to true to suggest updating pull request branches. + Set to `true` to suggest updating pull request branches. END } From 2dff8916eff34a4e1ff3f1adf0c018a20f1142ae Mon Sep 17 00:00:00 2001 From: Tobias Lindberg Date: Mon, 10 Jul 2023 16:42:13 +0200 Subject: [PATCH 3/3] update versions.tf with required provider version --- versions.tf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/versions.tf b/versions.tf index 01e52ac..0c87a04 100644 --- a/versions.tf +++ b/versions.tf @@ -9,7 +9,7 @@ terraform { required_providers { github = { source = "integrations/github" - version = ">= 4.20, < 6.0" + version = ">= 5.8, < 6.0" } } }