From f9fe3a0a257b40321921b47d16daa6d68bb00812 Mon Sep 17 00:00:00 2001 From: arnol377 Date: Fri, 18 Oct 2024 14:16:14 -0400 Subject: [PATCH 1/4] adding workspaces to current repos --- repolist.tf | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/repolist.tf b/repolist.tf index 90297b0..7f8c645 100644 --- a/repolist.tf +++ b/repolist.tf @@ -16,3 +16,18 @@ module "repo_list" { github_org_teams = local.github_organization_teams } + +module "workspace" { + source = "HappyPathway/workspace/github" + for_each = tomap({ for repo in var.repolist : repo.name => repo }) + runner_group = "229685449397" + repo_name = each.value.name + repo_org = each.value.repo_org + reviewers = 1 + protected_branches = true + custom_branch_policies = true + environment = "default" + branch = { + name = "main" + } +} From a2fe8aa4874479bc047acd108f94382414ddb134 Mon Sep 17 00:00:00 2001 From: arnol377 Date: Fri, 25 Oct 2024 13:06:31 -0400 Subject: [PATCH 2/4] adding environments --- repolist.tf | 3 ++- varfiles/default.tfvars | 1 + variables.tf | 1 + versions.tf | 4 ---- 4 files changed, 4 insertions(+), 5 deletions(-) diff --git a/repolist.tf b/repolist.tf index 7f8c645..9674ed1 100644 --- a/repolist.tf +++ b/repolist.tf @@ -19,11 +19,12 @@ module "repo_list" { module "workspace" { source = "HappyPathway/workspace/github" - for_each = tomap({ for repo in var.repolist : repo.name => repo }) + for_each = tomap({ for repo in var.repolist : repo.name => repo if repo.workspace }) runner_group = "229685449397" repo_name = each.value.name repo_org = each.value.repo_org reviewers = 1 + reviewers_users = keys(local.collaborators) protected_branches = true custom_branch_policies = true environment = "default" diff --git a/varfiles/default.tfvars b/varfiles/default.tfvars index 4290323..3b624bd 100644 --- a/varfiles/default.tfvars +++ b/varfiles/default.tfvars @@ -21,6 +21,7 @@ repolist = [ repo_topics = [ "terraform-tools" ] + workspace = true }, { description = "Managing AWS Github Runner Image" diff --git a/variables.tf b/variables.tf index e3276d1..84c49fe 100644 --- a/variables.tf +++ b/variables.tf @@ -12,6 +12,7 @@ variable "repolist" { enforce_prs = optional(bool, false) repo_topics = optional(list(string), ["terraform-workspace"]) is_private = optional(bool, false) + workspace = optional(bool, false) })) default = [] } diff --git a/versions.tf b/versions.tf index 1030799..32b8f4a 100644 --- a/versions.tf +++ b/versions.tf @@ -1,9 +1,5 @@ terraform { required_providers { - random = { - source = "integrations/github" - version = ">= 6.3.0" - } aws = { source = "hashicorp/aws" version = ">= 2.0.0" From b3063d48affea25cb9a88cf57967ed2476b16c1f Mon Sep 17 00:00:00 2001 From: arnol377 Date: Fri, 25 Oct 2024 13:48:51 -0400 Subject: [PATCH 3/4] updating repolist --- repolist.tf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/repolist.tf b/repolist.tf index 9674ed1..d729b6c 100644 --- a/repolist.tf +++ b/repolist.tf @@ -26,7 +26,7 @@ module "workspace" { reviewers = 1 reviewers_users = keys(local.collaborators) protected_branches = true - custom_branch_policies = true + custom_branch_policies = false environment = "default" branch = { name = "main" From 2fb903cf2cb5bc69fd37abda3c32f858df4d7f97 Mon Sep 17 00:00:00 2001 From: David John Arnold Jr Date: Fri, 25 Oct 2024 11:01:41 -0700 Subject: [PATCH 4/4] Update terraform_codebuild_plan.yaml --- .github/workflows/terraform_codebuild_plan.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/terraform_codebuild_plan.yaml b/.github/workflows/terraform_codebuild_plan.yaml index 39353a5..55c55a9 100644 --- a/.github/workflows/terraform_codebuild_plan.yaml +++ b/.github/workflows/terraform_codebuild_plan.yaml @@ -7,7 +7,7 @@ on: workflow_dispatch: concurrency: - group: ${{ github.repo }}-${{ vars.terraform_workspace }} + group: ${{ github.repo }}-${{ vars.terraform_workspace }}-codebuild permissions: write-all # A workflow run is made up of one or more jobs that can run sequentially or in parallel