Skip to content

Commit

Permalink
adding config + pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
ConnorOKane-Kainos committed Jul 3, 2024
1 parent 4873743 commit 9d33687
Showing 1 changed file with 0 additions and 24 deletions.
24 changes: 0 additions & 24 deletions components/main.tf
Original file line number Diff line number Diff line change
@@ -1,27 +1,3 @@
locals {
# Read the repositories list from the JSON file
repositories_list = jsondecode(file("${path.module}/test-repos.json"))

# Create a combination of repositories and branches
repo_branch_combinations = flatten([
for repo in local.repositories_list : [
for branch in var.branches : {
repo = repo
branch = branch
}
]
])
}

variable "branches" {
description = "List of branches to apply protection rules"
type = list(string)
default = [
"master",
"main"
]
}

# Check if branches exist
data "github_branch" "existing_branches" {
for_each = { for combo in local.repo_branch_combinations : "${combo.repo}:${combo.branch}" => combo }
Expand Down

0 comments on commit 9d33687

Please sign in to comment.