Skip to content

fix(github_files) output map for managed_extra_files and extra_files #1

Merged
merged 1 commit into from
Mar 17, 2026
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
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"
}
}
}
Loading