diff --git a/README.md b/README.md index eed6135..56bb75b 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..81f4f7e 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 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" } } }