diff --git a/repolist.tf b/repolist.tf index ec6e7c9..fc2ac77 100644 --- a/repolist.tf +++ b/repolist.tf @@ -1,3 +1,22 @@ +# Add a team to the organization +resource "github_team" "terraform_reviewers" { + name = "terraform-reviewers" + description = "Reviewers for changes in Terraform" + privacy = "closed" +} + +resource "github_team_members" "terraform_reviewer_members" { + team_id = github_team.terraform_reviewers.id + + dynamic members { + for_each = toset([for member, role in local.collaborators : member ]) + content { + username = members.key + role = "member" + } + } +} + module "repo_list" { source = "HappyPathway/repo/github" for_each = tomap({ for repo in var.repolist : repo.name => repo }) @@ -15,16 +34,3 @@ module "repo_list" { github_is_private = each.value.is_private github_org_teams = local.github_organization_teams } - - -module "workspace" { - source = "HappyPathway/workspace/github" - 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 = false -} diff --git a/varfiles/default.tfvars b/varfiles/default.tfvars index 1212e7d..a30c8c2 100644 --- a/varfiles/default.tfvars +++ b/varfiles/default.tfvars @@ -21,7 +21,6 @@ repolist = [ repo_topics = [ "terraform-tools" ] - workspace = true }, { description = "Managing AWS Github Runner Image" @@ -68,6 +67,15 @@ repolist = [ "supervisord", "automation" ] + }, + { + description = "test repo for github-terraform workspaces" + repo_org = "CSVD" + name = "github-workspaces" + is_private = false + repo_topics = [ + "github-actions" + ] } ]