Skip to content

feat: allow_update_branch option (Set to true to always suggest updating pull request branches.) #15

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all 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
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
repos:
- repo: https://github.com/mineiros-io/pre-commit-hooks
rev: v0.4.1
rev: v0.5.1
hooks:
- id: terraform-fmt
- id: terraform-validate
Expand Down
2 changes: 2 additions & 0 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ locals {
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_auto_merge = var.allow_auto_merge == null ? lookup(var.defaults, "allow_auto_merge", false) : var.allow_auto_merge
allow_update_branch = var.allow_update_branch == null ? lookup(var.defaults, "allow_update_branch", false) : var.allow_update_branch
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
has_downloads = var.has_downloads == null ? lookup(var.defaults, "has_downloads", false) : var.has_downloads
Expand Down Expand Up @@ -100,6 +101,7 @@ resource "github_repository" "repository" {
allow_rebase_merge = local.allow_rebase_merge
allow_squash_merge = local.allow_squash_merge
allow_auto_merge = local.allow_auto_merge
allow_update_branch = local.allow_update_branch
delete_branch_on_merge = local.delete_branch_on_merge
is_template = local.is_template
has_downloads = local.has_downloads
Expand Down
6 changes: 6 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,12 @@ variable "allow_auto_merge" {
default = null
}

variable "allow_update_branch" {
description = "(Optional) - Set to true to always suggest updating pull request branches."
type = bool
default = null
}

variable "delete_branch_on_merge" {
description = "(Optional) Whether or not to delete the merged branch after merging a pull request. (Default: false)"
type = bool
Expand Down