From b6176dd010ab7769ac5aa82c2be41aeab99b35ae Mon Sep 17 00:00:00 2001 From: Dave Arnold Date: Mon, 8 Jul 2024 10:50:28 -0700 Subject: [PATCH] chore: Refactor Terraform code for consistency and readability --- collaborators.tf | 2 +- github_repo.tf | 8 ++++---- variables.tf | 6 +++--- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/collaborators.tf b/collaborators.tf index 2f51727..12ee2d6 100644 --- a/collaborators.tf +++ b/collaborators.tf @@ -1,6 +1,6 @@ # Add a collaborator to a repository resource "github_repository_collaborator" "collaborators" { - for_each = tomap(var.collaborators) + for_each = tomap(var.collaborators) repository = github_repository.repo.name username = each.key permission = each.value diff --git a/github_repo.tf b/github_repo.tf index 275b17d..e766595 100644 --- a/github_repo.tf +++ b/github_repo.tf @@ -3,12 +3,12 @@ locals { } moved { - from = github_repository.repo - to = github_repository.repo_force_name + from = "github_repository.repo" + to = "github_repository.repo_force_name" } resource "github_repository" "repo_force_name" { - count = var.force_name ? 1 : 0 + count = var.force_name ? 1 : 0 name = local.repo_name description = var.github_repo_description visibility = var.github_is_private ? "private" : "public" @@ -45,7 +45,7 @@ resource "github_repository" "repo_force_name" { resource "github_repository" "repo_ignore_name_change" { - count = var.force_name ? 0 : 1 + count = var.force_name ? 0 : 1 name = local.repo_name description = var.github_repo_description visibility = var.github_is_private ? "private" : "public" diff --git a/variables.tf b/variables.tf index ee0abc0..02cf9f4 100644 --- a/variables.tf +++ b/variables.tf @@ -162,8 +162,8 @@ variable "enforce_prs" { type = bool } -variable collaborators { - type = map(string) +variable "collaborators" { + type = map(string) description = "list of repo callaborators" - default = {} + default = {} }