From ea3a4d098310f258b7e3a5c341e049e9b47b9ddb Mon Sep 17 00:00:00 2001 From: Simon Sprankel Date: Sun, 9 Jun 2024 22:20:44 +0200 Subject: [PATCH 1/2] Add mono repo push allowances, fixes #85 --- main.tf | 4 ++++ variables.tf | 21 ++++++++++++--------- 2 files changed, 16 insertions(+), 9 deletions(-) diff --git a/main.tf b/main.tf index 9907027..23e4091 100644 --- a/main.tf +++ b/main.tf @@ -142,6 +142,10 @@ resource "github_branch_protection" "repositories" { github_team.teams["tech-lead"].node_id, ] } + + restrict_pushes { + push_allowances = try(each.value.mono_repository, false) ? [data.github_user.mage-os-ci.node_id] : [] + } } resource "github_branch_default" "repositories" { diff --git a/variables.tf b/variables.tf index 61a4ac9..6b744bc 100644 --- a/variables.tf +++ b/variables.tf @@ -328,21 +328,24 @@ variable "repositories" { } mageos-async-events-aws = { - description = "This module provides events integrations to AWS." - teams = ["distribution", "async-events"] - topics = ["mage-os", "magento", "ecommerce", "magento2", "adobecommerce", "aws"] + description = "This module provides events integrations to AWS." + teams = ["distribution", "async-events"] + topics = ["mage-os", "magento", "ecommerce", "magento2", "adobecommerce", "aws"] + mono_repository = true } mageos-async-events-azure = { - description = "This module provides events integrations to Azure." - teams = ["distribution", "async-events"] - topics = ["mage-os", "magento", "ecommerce", "magento2", "adobecommerce", "azure"] + description = "This module provides events integrations to Azure." + teams = ["distribution", "async-events"] + topics = ["mage-os", "magento", "ecommerce", "magento2", "adobecommerce", "azure"] + mono_repository = true } mageos-async-events-gcp = { - description = "This module provides events integrations to GCP." - teams = ["distribution", "async-events"] - topics = ["mage-os", "magento", "ecommerce", "magento2", "adobecommerce", "gcp"] + description = "This module provides events integrations to GCP." + teams = ["distribution", "async-events"] + topics = ["mage-os", "magento", "ecommerce", "magento2", "adobecommerce", "gcp"] + mono_repository = true } mageos-async-events-admin-ui = { From 24eac420b00ea750d9421766fafa7ae53a401425 Mon Sep 17 00:00:00 2001 From: Simon Sprankel Date: Thu, 13 Jun 2024 07:22:08 +0200 Subject: [PATCH 2/2] Rename monorepo flag, #85 --- main.tf | 2 +- variables.tf | 24 ++++++++++++------------ 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/main.tf b/main.tf index 23e4091..6a4014a 100644 --- a/main.tf +++ b/main.tf @@ -144,7 +144,7 @@ resource "github_branch_protection" "repositories" { } restrict_pushes { - push_allowances = try(each.value.mono_repository, false) ? [data.github_user.mage-os-ci.node_id] : [] + push_allowances = try(each.value.is_part_of_monorepo, false) ? [data.github_user.mage-os-ci.node_id] : [] } } diff --git a/variables.tf b/variables.tf index 6b744bc..0f0f239 100644 --- a/variables.tf +++ b/variables.tf @@ -328,24 +328,24 @@ variable "repositories" { } mageos-async-events-aws = { - description = "This module provides events integrations to AWS." - teams = ["distribution", "async-events"] - topics = ["mage-os", "magento", "ecommerce", "magento2", "adobecommerce", "aws"] - mono_repository = true + description = "This module provides events integrations to AWS." + teams = ["distribution", "async-events"] + topics = ["mage-os", "magento", "ecommerce", "magento2", "adobecommerce", "aws"] + is_part_of_monorepo = true } mageos-async-events-azure = { - description = "This module provides events integrations to Azure." - teams = ["distribution", "async-events"] - topics = ["mage-os", "magento", "ecommerce", "magento2", "adobecommerce", "azure"] - mono_repository = true + description = "This module provides events integrations to Azure." + teams = ["distribution", "async-events"] + topics = ["mage-os", "magento", "ecommerce", "magento2", "adobecommerce", "azure"] + is_part_of_monorepo = true } mageos-async-events-gcp = { - description = "This module provides events integrations to GCP." - teams = ["distribution", "async-events"] - topics = ["mage-os", "magento", "ecommerce", "magento2", "adobecommerce", "gcp"] - mono_repository = true + description = "This module provides events integrations to GCP." + teams = ["distribution", "async-events"] + topics = ["mage-os", "magento", "ecommerce", "magento2", "adobecommerce", "gcp"] + is_part_of_monorepo = true } mageos-async-events-admin-ui = {