Skip to content

Commit

Permalink
Remove unnecessary blank lines in github_files.tf for improved readab…
Browse files Browse the repository at this point in the history
…ility
  • Loading branch information
Dave Arnold committed Feb 19, 2025
1 parent 5cf01a8 commit a2b9b6f
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions github_files.tf
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
locals {
repo_exists = var.create_repo ? github_repository.repo[0] : data.github_repository.existing[0]

# Process files only if commit signing is not required or if explicitly allowed
should_manage_files = !try(local.repo_exists.require_signed_commits, false) || var.allow_unsigned_files
}
Expand All @@ -17,7 +17,7 @@ resource "github_repository_file" "codeowners" {
commit_author = var.commit_author
commit_email = var.commit_email
overwrite_on_create = true

lifecycle {
ignore_changes = [
content,
Expand Down Expand Up @@ -53,7 +53,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 }) : {}

repository = local.repo_exists.name
branch = var.github_default_branch
file = each.value.path
Expand All @@ -62,7 +62,7 @@ resource "github_repository_file" "extra_files" {
commit_author = var.commit_author
commit_email = var.commit_email
overwrite_on_create = true

lifecycle {
ignore_changes = [
content,
Expand All @@ -73,7 +73,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 }) : {}

repository = local.repo_exists.name
branch = var.github_default_branch
file = each.value.path
Expand All @@ -82,7 +82,7 @@ resource "github_repository_file" "managed_extra_files" {
commit_author = var.commit_author
commit_email = var.commit_email
overwrite_on_create = true

lifecycle {
ignore_changes = [
branch
Expand Down

0 comments on commit a2b9b6f

Please sign in to comment.