Skip to content

Commit

Permalink
fix(github_files) output map for managed_extra_files and extra_files (#1
Browse files Browse the repository at this point in the history
)
  • Loading branch information
morga471 committed Mar 17, 2026
1 parent 5505602 commit a2756b3
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 31 deletions.
59 changes: 30 additions & 29 deletions .terraform.lock.hcl

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions github_files.tf
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ locals {
}

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

repository = local.github_repo.name
branch = var.files_branch == null ? var.github_default_branch : var.files_branch
Expand All @@ -83,7 +83,7 @@ resource "github_repository_file" "extra_files" {
}

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

repository = local.github_repo.name
branch = var.files_branch == null ? var.github_default_branch : var.files_branch
Expand Down
1 change: 1 addition & 0 deletions versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ terraform {
required_providers {
github = {
source = "integrations/github"
version = "~> 6.11"
}
}
}

0 comments on commit a2756b3

Please sign in to comment.