Skip to content

Commit

Permalink
adding a github-workspaces repo
Browse files Browse the repository at this point in the history
  • Loading branch information
arnol377 committed Oct 28, 2024
1 parent d34c32b commit 2736440
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 14 deletions.
32 changes: 19 additions & 13 deletions repolist.tf
Original file line number Diff line number Diff line change
@@ -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 })
Expand All @@ -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
}
10 changes: 9 additions & 1 deletion varfiles/default.tfvars
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ repolist = [
repo_topics = [
"terraform-tools"
]
workspace = true
},
{
description = "Managing AWS Github Runner Image"
Expand Down Expand Up @@ -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"
]
}
]

0 comments on commit 2736440

Please sign in to comment.