From b8fc72ca5d6bc18ab451400c6f44794fa0df06b1 Mon Sep 17 00:00:00 2001 From: Kevin Mahoney Date: Fri, 9 Feb 2024 12:10:20 +0100 Subject: [PATCH 1/4] feat: add [squash_merge|merge]_commit_[messsage|title] --- main.tf | 6 ++++++ variables.tf | 24 ++++++++++++++++++++++++ 2 files changed, 30 insertions(+) diff --git a/main.tf b/main.tf index 587e1bb..aecaa08 100644 --- a/main.tf +++ b/main.tf @@ -109,6 +109,12 @@ resource "github_repository" "repository" { archived = var.archived topics = local.topics + merge_commit_message = var.merge_commit_message + merge_commit_title = var.merge_commit_title + + squash_merge_commit_message = var.squash_merge_commit_message + squash_merge_commit_title = var.squash_merge_commit_title + archive_on_destroy = var.archive_on_destroy vulnerability_alerts = local.vulnerability_alerts diff --git a/variables.tf b/variables.tf index 7599034..804db30 100644 --- a/variables.tf +++ b/variables.tf @@ -161,6 +161,30 @@ variable "topics" { default = null } +variable "merge_commit_title" { + description = "Can be PR_TITLE or MERGE_MESSAGE for a default merge commit title. Applicable only if allow_merge_commit is true." + type = string + default = null +} + +variable "merge_commit_message" { + description = "Can be PR_BODY, PR_TITLE, or BLANK for a default merge commit message. Applicable only if allow_merge_commit is true." + type = string + default = null +} + +variable "squash_merge_commit_title" { + description = "(Optional) Can be PR_TITLE or COMMIT_OR_PR_TITLE for a default squash merge commit title. Applicable only if allow_squash_merge is true." + type = string + default = null +} + +variable "squash_merge_commit_message" { + description = "(Optional) Can be PR_BODY, COMMIT_MESSAGES, or BLANK for a default squash merge commit message. Applicable only if allow_squash_merge is true." + type = string + default = null +} + variable "extra_topics" { description = "(Optional) The list of additional topics of the repository. (Default: [])" type = list(string) From a67a802c3de69861d3fc68645486726175ecb31d Mon Sep 17 00:00:00 2001 From: Kevin Mahoney Date: Thu, 16 May 2024 11:38:45 +0200 Subject: [PATCH 2/4] fix tests --- main.tf | 1 + 1 file changed, 1 insertion(+) diff --git a/main.tf b/main.tf index aecaa08..3cbc85b 100644 --- a/main.tf +++ b/main.tf @@ -267,6 +267,7 @@ resource "github_branch_protection_v3" "branch_protection" { content { strict = required_status_checks.value.strict contexts = required_status_checks.value.contexts + checks = required_status_checks.value.contexts } } From 75ba3829a8aff4125429ad8545d61a433a54f17e Mon Sep 17 00:00:00 2001 From: Kevin Mahoney Date: Thu, 16 May 2024 11:41:52 +0200 Subject: [PATCH 3/4] attempt 2 fix tests --- main.tf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.tf b/main.tf index 3cbc85b..8a074a8 100644 --- a/main.tf +++ b/main.tf @@ -266,7 +266,7 @@ resource "github_branch_protection_v3" "branch_protection" { content { strict = required_status_checks.value.strict - contexts = required_status_checks.value.contexts + # contexts = required_status_checks.value.contexts checks = required_status_checks.value.contexts } } From 214800d96c7d0fe582387f91ad10dc5838e4f14a Mon Sep 17 00:00:00 2001 From: Kevin Mahoney Date: Thu, 16 May 2024 11:43:31 +0200 Subject: [PATCH 4/4] fmt --- main.tf | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/main.tf b/main.tf index 8a074a8..725841b 100644 --- a/main.tf +++ b/main.tf @@ -265,9 +265,8 @@ resource "github_branch_protection_v3" "branch_protection" { for_each = local.required_status_checks[count.index] content { - strict = required_status_checks.value.strict - # contexts = required_status_checks.value.contexts - checks = required_status_checks.value.contexts + strict = required_status_checks.value.strict + checks = required_status_checks.value.contexts } }