Skip to content

GitHub workspace #30

Merged
merged 6 commits into from
Oct 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/terraform_codebuild_plan.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
16 changes: 16 additions & 0 deletions repolist.tf
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,19 @@ 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 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
environment = "default"
branch = {
name = "main"
}
}
1 change: 1 addition & 0 deletions varfiles/default.tfvars
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ repolist = [
repo_topics = [
"terraform-tools"
]
workspace = true
},
{
description = "Managing AWS Github Runner Image"
Expand Down
1 change: 1 addition & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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 = []
}
4 changes: 0 additions & 4 deletions versions.tf
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
terraform {
required_providers {
random = {
source = "integrations/github"
version = ">= 6.3.0"
}
aws = {
source = "hashicorp/aws"
version = ">= 2.0.0"
Expand Down