From 73edcf4d3b5dfddc734257cd8be29be3a1eadc9d Mon Sep 17 00:00:00 2001 From: Dave Arnold Date: Wed, 21 Aug 2024 16:51:53 -0700 Subject: [PATCH] chore: Update Terraform provider version for GitHub to >= 6.2.3 --- .github/workflows/terraform.yml | 17 +++++++++++++++++ github_repo.tf | 3 ++- variables.tf | 10 ++++++++-- 3 files changed, 27 insertions(+), 3 deletions(-) create mode 100644 .github/workflows/terraform.yml diff --git a/.github/workflows/terraform.yml b/.github/workflows/terraform.yml new file mode 100644 index 0000000..bf78fd0 --- /dev/null +++ b/.github/workflows/terraform.yml @@ -0,0 +1,17 @@ +name: "Terraform" + +on: + workflow_dispatch: + pull_request: + +jobs: + terraform: + uses: HappyPathway/centralized-actions/.github/workflows/terraform.yml@main + with: + terraform_version: 1.9.1 + terraform_api: app.terraform.io + github_username: djaboxx + github_email: git@roknsound.com + secrets: + TFE_TOKEN: ${{ secrets.TFE_TOKEN }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file diff --git a/github_repo.tf b/github_repo.tf index 85f372d..4e542bd 100644 --- a/github_repo.tf +++ b/github_repo.tf @@ -2,6 +2,7 @@ locals { repo_name = var.force_name ? var.name : "${var.name}-${formatdate("YYYYMMDD", timestamp())}" } + resource "github_repository" "repo" { name = local.repo_name description = var.github_repo_description @@ -10,7 +11,7 @@ resource "github_repository" "repo" { allow_merge_commit = var.github_allow_merge_commit allow_squash_merge = var.github_allow_squash_merge allow_rebase_merge = var.github_allow_rebase_merge - archive_on_destroy = true + archive_on_destroy = var.archive_on_destroy delete_branch_on_merge = var.github_delete_branch_on_merge has_projects = var.github_has_projects has_issues = var.github_has_issues diff --git a/variables.tf b/variables.tf index 0523e85..cf78f8e 100644 --- a/variables.tf +++ b/variables.tf @@ -125,11 +125,11 @@ information. For workflows that use reusable workflows, the pattern is / . This can extend multiple levels. EOT - type = object({ + type = object({ contexts = list(string) strict = optional(bool, false) }) - default = null + default = null } variable "archived" { @@ -192,3 +192,9 @@ variable "collaborators" { description = "list of repo callaborators" default = {} } + + +variable "archive_on_destroy" { + type = bool + default = true +}