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

feat: add support for allow_update_branch #155

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 2 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
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`)*<a name="var-allow_update_branch"></a>

Set to `true` to suggest updating pull request branches.

Default is `false`.

- [**`allow_auto_merge`**](#var-allow_auto_merge): *(Optional `bool`)*<a name="var-allow_auto_merge"></a>

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)
Expand Down
8 changes: 8 additions & 0 deletions README.tfdoc.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
6 changes: 6 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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
tobiasehlert marked this conversation as resolved.
Show resolved Hide resolved
}

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
Expand Down