From 56c9c991e98f5f0d2d35083b1673ae06a27ddc38 Mon Sep 17 00:00:00 2001 From: David John Arnold Jr Date: Thu, 15 Aug 2024 11:44:13 -0700 Subject: [PATCH 01/11] Update backend.tf --- backend.tf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/backend.tf b/backend.tf index 96d1478..9f61e98 100644 --- a/backend.tf +++ b/backend.tf @@ -1,8 +1,8 @@ terraform { backend "s3" { bucket = "inf-tfstate-229685449397" - key = "csvd-dev-gov/common/apps/terraform-repos" + key = "csvd-dev-gov/common/apps/terraform-repos" region = "us-gov-east-1" dynamodb_table = "tf_remote_state" } -} \ No newline at end of file +} From e7ddde8eed69a3c0a112bc147b692f31949742e0 Mon Sep 17 00:00:00 2001 From: David John Arnold Jr Date: Thu, 15 Aug 2024 11:48:29 -0700 Subject: [PATCH 02/11] Update terraform_plan.yaml --- .github/workflows/terraform_plan.yaml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/.github/workflows/terraform_plan.yaml b/.github/workflows/terraform_plan.yaml index b0f09ab..0c3cf66 100644 --- a/.github/workflows/terraform_plan.yaml +++ b/.github/workflows/terraform_plan.yaml @@ -39,12 +39,20 @@ jobs: - name: Terraform Format id: fmt run: | - terraform fmt -check + terraform fmt + if ! git diff-index --quiet HEAD; then + git config --global user.name '${{ vars.REPO_OWNER }}' + git config --global user.email '${{ vars.REPO_OWNER_EMAIL }}' + git commit -am "Autoformatting TF Code" + git push + echo "auto_format=true" >> $GITHUB_ENV + fi - name: Autoformat Halt if: env.auto_format == 'true' run: exit 1 + - name: Terraform Init id: init run: terraform init -upgrade From b7afb6b7bd0fac874efb5e76f2aeb25649199a55 Mon Sep 17 00:00:00 2001 From: David John Arnold Jr Date: Thu, 15 Aug 2024 11:52:30 -0700 Subject: [PATCH 03/11] Update terraform_plan.yaml --- .github/workflows/terraform_plan.yaml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/terraform_plan.yaml b/.github/workflows/terraform_plan.yaml index 0c3cf66..3a73efd 100644 --- a/.github/workflows/terraform_plan.yaml +++ b/.github/workflows/terraform_plan.yaml @@ -36,6 +36,10 @@ jobs: with: terraform_version: ${{ vars.terraform_version }} + - name: Set output + id: vars + run: echo ::set-output name=short_ref::${GITHUB_REF#refs/*/} + - name: Terraform Format id: fmt run: | @@ -44,7 +48,7 @@ jobs: git config --global user.name '${{ vars.REPO_OWNER }}' git config --global user.email '${{ vars.REPO_OWNER_EMAIL }}' git commit -am "Autoformatting TF Code" - git push + git push origin HEAD:${{ steps.vars.outputs.short_ref }} echo "auto_format=true" >> $GITHUB_ENV fi From 01ab8928dce14deb01367882e370a99fd7ac8fe3 Mon Sep 17 00:00:00 2001 From: David John Arnold Jr Date: Thu, 15 Aug 2024 11:56:12 -0700 Subject: [PATCH 04/11] Update terraform_plan.yaml --- .github/workflows/terraform_plan.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/terraform_plan.yaml b/.github/workflows/terraform_plan.yaml index 3a73efd..4ef43a2 100644 --- a/.github/workflows/terraform_plan.yaml +++ b/.github/workflows/terraform_plan.yaml @@ -42,13 +42,13 @@ jobs: - name: Terraform Format id: fmt + uses: actions/checkout@v4 run: | terraform fmt if ! git diff-index --quiet HEAD; then git config --global user.name '${{ vars.REPO_OWNER }}' git config --global user.email '${{ vars.REPO_OWNER_EMAIL }}' git commit -am "Autoformatting TF Code" - git push origin HEAD:${{ steps.vars.outputs.short_ref }} echo "auto_format=true" >> $GITHUB_ENV fi From 512f3b24c33be16f34b22185a94b499d46b650db Mon Sep 17 00:00:00 2001 From: David John Arnold Jr Date: Thu, 15 Aug 2024 11:58:15 -0700 Subject: [PATCH 05/11] Update terraform_plan.yaml --- .github/workflows/terraform_plan.yaml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/terraform_plan.yaml b/.github/workflows/terraform_plan.yaml index 4ef43a2..18443cf 100644 --- a/.github/workflows/terraform_plan.yaml +++ b/.github/workflows/terraform_plan.yaml @@ -23,7 +23,7 @@ jobs: # Steps represent a sequence of tasks that will be executed as part of the job steps: # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: github-server-url: https://github.e.it.census.gov @@ -42,7 +42,6 @@ jobs: - name: Terraform Format id: fmt - uses: actions/checkout@v4 run: | terraform fmt if ! git diff-index --quiet HEAD; then From b6b5d80da28ca8c5c40ae06907f7ff8aac9b1cf5 Mon Sep 17 00:00:00 2001 From: David John Arnold Jr Date: Thu, 15 Aug 2024 12:25:50 -0700 Subject: [PATCH 06/11] Update terraform_plan.yaml --- .github/workflows/terraform_plan.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/terraform_plan.yaml b/.github/workflows/terraform_plan.yaml index 18443cf..4ab182d 100644 --- a/.github/workflows/terraform_plan.yaml +++ b/.github/workflows/terraform_plan.yaml @@ -23,7 +23,7 @@ jobs: # Steps represent a sequence of tasks that will be executed as part of the job steps: # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - uses: actions/checkout@v4 + - uses: CSVD/gh-actions-checkout@v4 with: github-server-url: https://github.e.it.census.gov From 0c935bb02e201cfc168713b62994491314680429 Mon Sep 17 00:00:00 2001 From: David John Arnold Jr Date: Thu, 15 Aug 2024 12:27:06 -0700 Subject: [PATCH 07/11] Update terraform_plan.yaml --- .github/workflows/terraform_plan.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/terraform_plan.yaml b/.github/workflows/terraform_plan.yaml index 4ab182d..51a4aa7 100644 --- a/.github/workflows/terraform_plan.yaml +++ b/.github/workflows/terraform_plan.yaml @@ -23,7 +23,7 @@ jobs: # Steps represent a sequence of tasks that will be executed as part of the job steps: # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - uses: CSVD/gh-actions-checkout@v4 + - uses: CSVD/gh-actions-checkout@v3 with: github-server-url: https://github.e.it.census.gov From f026c86403e1bea5a3d5c3eec0cbdbc6a877b205 Mon Sep 17 00:00:00 2001 From: David John Arnold Jr Date: Thu, 15 Aug 2024 12:28:39 -0700 Subject: [PATCH 08/11] Update terraform_plan.yaml --- .github/workflows/terraform_plan.yaml | 5 ----- 1 file changed, 5 deletions(-) diff --git a/.github/workflows/terraform_plan.yaml b/.github/workflows/terraform_plan.yaml index 51a4aa7..c0fc2c8 100644 --- a/.github/workflows/terraform_plan.yaml +++ b/.github/workflows/terraform_plan.yaml @@ -51,11 +51,6 @@ jobs: echo "auto_format=true" >> $GITHUB_ENV fi - - name: Autoformat Halt - if: env.auto_format == 'true' - run: exit 1 - - - name: Terraform Init id: init run: terraform init -upgrade From 459bed9e024f86ca728f222d3b935b293a17bef4 Mon Sep 17 00:00:00 2001 From: David John Arnold Jr Date: Thu, 15 Aug 2024 12:32:25 -0700 Subject: [PATCH 09/11] Update terraform_plan.yaml --- .github/workflows/terraform_plan.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/terraform_plan.yaml b/.github/workflows/terraform_plan.yaml index c0fc2c8..8e2a018 100644 --- a/.github/workflows/terraform_plan.yaml +++ b/.github/workflows/terraform_plan.yaml @@ -48,6 +48,7 @@ jobs: git config --global user.name '${{ vars.REPO_OWNER }}' git config --global user.email '${{ vars.REPO_OWNER_EMAIL }}' git commit -am "Autoformatting TF Code" + git push echo "auto_format=true" >> $GITHUB_ENV fi From 06099df8ec2c12a75640d4b91a239b4e0d376981 Mon Sep 17 00:00:00 2001 From: David John Arnold Jr Date: Thu, 15 Aug 2024 12:40:53 -0700 Subject: [PATCH 10/11] Update terraform_plan.yaml --- .github/workflows/terraform_plan.yaml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/terraform_plan.yaml b/.github/workflows/terraform_plan.yaml index 8e2a018..27c283f 100644 --- a/.github/workflows/terraform_plan.yaml +++ b/.github/workflows/terraform_plan.yaml @@ -26,6 +26,8 @@ jobs: - uses: CSVD/gh-actions-checkout@v3 with: github-server-url: https://github.e.it.census.gov + ref: ${{ github.head_ref }} + token: ${{ secrets.GH_TOKEN }} - uses: CSVD/gh-actions-setup-node@v3 @@ -52,6 +54,10 @@ jobs: echo "auto_format=true" >> $GITHUB_ENV fi + - name: Autoformat Halt + if: env.auto_format == 'true' + run: exit 0 + - name: Terraform Init id: init run: terraform init -upgrade From bab0cce890f9f82dbad0a09e18457450bad52d0e Mon Sep 17 00:00:00 2001 From: arnol377 Date: Thu, 15 Aug 2024 15:41:25 -0400 Subject: [PATCH 11/11] Autoformatting TF Code --- backend.tf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend.tf b/backend.tf index 9f61e98..aa514fb 100644 --- a/backend.tf +++ b/backend.tf @@ -1,7 +1,7 @@ terraform { backend "s3" { bucket = "inf-tfstate-229685449397" - key = "csvd-dev-gov/common/apps/terraform-repos" + key = "csvd-dev-gov/common/apps/terraform-repos" region = "us-gov-east-1" dynamodb_table = "tf_remote_state" }