Skip to content

Commit

Permalink
GitHub workspace (#30)
Browse files Browse the repository at this point in the history
* adding workspaces to current repos

* adding environments

* updating repolist

* Update terraform_codebuild_plan.yaml
  • Loading branch information
arnol377 committed Oct 25, 2024
1 parent 556ecd1 commit 717f788
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 5 deletions.
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

0 comments on commit 717f788

Please sign in to comment.