Skip to content

Commit

Permalink
Refactor for_each syntax in GitHub repository file resources for cons…
Browse files Browse the repository at this point in the history
…istency
  • Loading branch information
Dave Arnold committed Feb 19, 2025
1 parent 0d9f263 commit 42d38a7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions github_files.tf
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ locals {
}

resource "github_repository_file" "extra_files" {
for_each = tomap({ for file in local.extra_files : "${element(split("/", file.path), length(split("/", file.path)) - 1)}" => file })
for_each = tomap({ for file in local.extra_files : "${element(split("/", file.path), length(split("/", file.path)) - 1)}" => file })

repository = local.repository_name
branch = var.github_default_branch
Expand All @@ -63,7 +63,7 @@ resource "github_repository_file" "extra_files" {
}

resource "github_repository_file" "managed_extra_files" {
for_each = tomap({ for file in var.managed_extra_files : "${element(split("/", file.path), length(split("/", file.path)) - 1)}" => file })
for_each = tomap({ for file in var.managed_extra_files : "${element(split("/", file.path), length(split("/", file.path)) - 1)}" => file })

repository = local.repository_name
branch = var.github_default_branch
Expand Down

0 comments on commit 42d38a7

Please sign in to comment.