From 5b1b0f492847985ea2af238ff07142c7011e123c Mon Sep 17 00:00:00 2001 From: Igor Rodionov Date: Thu, 18 Jul 2024 01:17:42 +0300 Subject: [PATCH 01/12] Fix opentofu init on apply --- action.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/action.yml b/action.yml index 33bbcd2..dfea20a 100644 --- a/action.yml +++ b/action.yml @@ -331,6 +331,8 @@ runs: TERRAFORM_RESULT=$? set -e + + cat "${TERRAFORM_OUTPUT_FILE}" ${{ steps.command.outputs.value }} output --json > output_values.json @@ -340,8 +342,6 @@ runs: sed -i "s#\`\"#\`#g" ${{ github.workspace }}/atmos-apply-summary.md sed -i "s#\"\`#\`#g" ${{ github.workspace }}/atmos-apply-summary.md sed -i "s#|--#|:-#g" ${{ github.workspace }}/atmos-apply-summary.md - - cat "${TERRAFORM_OUTPUT_FILE}" cat "${{ github.workspace }}/atmos-apply-summary.md" >> $GITHUB_STEP_SUMMARY From 2916fa9d0c27923c8f68b3b096ec4556c0e001d2 Mon Sep 17 00:00:00 2001 From: Igor Rodionov Date: Thu, 18 Jul 2024 01:41:11 +0300 Subject: [PATCH 02/12] Update action.yml --- action.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/action.yml b/action.yml index dfea20a..e1bd55b 100644 --- a/action.yml +++ b/action.yml @@ -333,6 +333,9 @@ runs: set -e cat "${TERRAFORM_OUTPUT_FILE}" + + # Init backend required to get outputs + atmos terraform init ${{ inputs.component }} --stack ${{ inputs.stack }} -no-color ${{ steps.command.outputs.value }} output --json > output_values.json From 54b55943f1aa2a93cfc61716ef414f870b41490c Mon Sep 17 00:00:00 2001 From: Igor Rodionov Date: Thu, 18 Jul 2024 01:56:35 +0300 Subject: [PATCH 03/12] Update action.yml --- action.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/action.yml b/action.yml index e1bd55b..6324a23 100644 --- a/action.yml +++ b/action.yml @@ -336,7 +336,8 @@ runs: # Init backend required to get outputs atmos terraform init ${{ inputs.component }} --stack ${{ inputs.stack }} -no-color - + pwd + ls -l ${{ steps.command.outputs.value }} output --json > output_values.json terraform-docs -c ${{ github.action_path }}/config/tfdocs-config.yaml --output-file ${{ github.workspace }}/atmos-apply-summary.md ./ From 68166ecd145e9dcef98aede8a3e350d9b110a2b9 Mon Sep 17 00:00:00 2001 From: Igor Rodionov Date: Thu, 18 Jul 2024 02:12:51 +0300 Subject: [PATCH 04/12] Update action.yml --- action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/action.yml b/action.yml index 6324a23..1ed2eae 100644 --- a/action.yml +++ b/action.yml @@ -337,7 +337,7 @@ runs: # Init backend required to get outputs atmos terraform init ${{ inputs.component }} --stack ${{ inputs.stack }} -no-color pwd - ls -l + ls -la ${{ steps.command.outputs.value }} output --json > output_values.json terraform-docs -c ${{ github.action_path }}/config/tfdocs-config.yaml --output-file ${{ github.workspace }}/atmos-apply-summary.md ./ From c9300addf228b6e0e2dee3e4eca6d23cc75895d4 Mon Sep 17 00:00:00 2001 From: Igor Rodionov Date: Thu, 18 Jul 2024 02:41:58 +0300 Subject: [PATCH 05/12] Update action.yml --- action.yml | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/action.yml b/action.yml index 1ed2eae..3b89e92 100644 --- a/action.yml +++ b/action.yml @@ -334,13 +334,9 @@ runs: cat "${TERRAFORM_OUTPUT_FILE}" - # Init backend required to get outputs - atmos terraform init ${{ inputs.component }} --stack ${{ inputs.stack }} -no-color - pwd - ls -la ${{ steps.command.outputs.value }} output --json > output_values.json - terraform-docs -c ${{ github.action_path }}/config/tfdocs-config.yaml --output-file ${{ github.workspace }}/atmos-apply-summary.md ./ + # terraform-docs -c ${{ github.action_path }}/config/tfdocs-config.yaml --output-file ${{ github.workspace }}/atmos-apply-summary.md ./ sed -i "s#\`\`#![Sensitive](https://img.shields.io/badge/sensitive-c40000?style=for-the-badge)#g" ${{ github.workspace }}/atmos-apply-summary.md sed -i "s#\`\"#\`#g" ${{ github.workspace }}/atmos-apply-summary.md From 2c8f97563c94f4e0f505307e4d86979d9376cb2b Mon Sep 17 00:00:00 2001 From: Igor Rodionov Date: Thu, 18 Jul 2024 03:12:18 +0300 Subject: [PATCH 06/12] Update action.yml --- action.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/action.yml b/action.yml index 3b89e92..5615224 100644 --- a/action.yml +++ b/action.yml @@ -334,9 +334,9 @@ runs: cat "${TERRAFORM_OUTPUT_FILE}" - ${{ steps.command.outputs.value }} output --json > output_values.json + ${{ steps.command.outputs.value }} output --json -state=$(find . -name terraform.tfstate) > output_values.json - # terraform-docs -c ${{ github.action_path }}/config/tfdocs-config.yaml --output-file ${{ github.workspace }}/atmos-apply-summary.md ./ + terraform-docs -c ${{ github.action_path }}/config/tfdocs-config.yaml --output-file ${{ github.workspace }}/atmos-apply-summary.md ./ sed -i "s#\`\`#![Sensitive](https://img.shields.io/badge/sensitive-c40000?style=for-the-badge)#g" ${{ github.workspace }}/atmos-apply-summary.md sed -i "s#\`\"#\`#g" ${{ github.workspace }}/atmos-apply-summary.md From 1e37c98fd16d9d53a6f2647eee3de2f7103fce1b Mon Sep 17 00:00:00 2001 From: Igor Rodionov Date: Thu, 18 Jul 2024 03:22:02 +0300 Subject: [PATCH 07/12] Update action.yml --- action.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/action.yml b/action.yml index 5615224..2e6535b 100644 --- a/action.yml +++ b/action.yml @@ -334,7 +334,8 @@ runs: cat "${TERRAFORM_OUTPUT_FILE}" - ${{ steps.command.outputs.value }} output --json -state=$(find . -name terraform.tfstate) > output_values.json + find . -name terraform.tfstate + ${{ steps.command.outputs.value }} output -json -state=$(find . -name terraform.tfstate) > output_values.json terraform-docs -c ${{ github.action_path }}/config/tfdocs-config.yaml --output-file ${{ github.workspace }}/atmos-apply-summary.md ./ From 13edd2a0cfde65a1e888c93338cfc261fd187734 Mon Sep 17 00:00:00 2001 From: Igor Rodionov Date: Thu, 18 Jul 2024 03:53:34 +0300 Subject: [PATCH 08/12] Update action.yml --- action.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/action.yml b/action.yml index 2e6535b..37dacd2 100644 --- a/action.yml +++ b/action.yml @@ -334,8 +334,7 @@ runs: cat "${TERRAFORM_OUTPUT_FILE}" - find . -name terraform.tfstate - ${{ steps.command.outputs.value }} output -json -state=$(find . -name terraform.tfstate) > output_values.json + TF_DATA_DIR=$(find . -name terraform.tfstate | dirname) ${{ steps.command.outputs.value }} output -json > output_values.json terraform-docs -c ${{ github.action_path }}/config/tfdocs-config.yaml --output-file ${{ github.workspace }}/atmos-apply-summary.md ./ From 78b3256d0f8d2afb9d927ef5c10ee3b313d17711 Mon Sep 17 00:00:00 2001 From: Igor Rodionov Date: Thu, 18 Jul 2024 04:02:51 +0300 Subject: [PATCH 09/12] Update action.yml --- action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/action.yml b/action.yml index 37dacd2..010ecff 100644 --- a/action.yml +++ b/action.yml @@ -334,7 +334,7 @@ runs: cat "${TERRAFORM_OUTPUT_FILE}" - TF_DATA_DIR=$(find . -name terraform.tfstate | dirname) ${{ steps.command.outputs.value }} output -json > output_values.json + ${{ steps.command.outputs.value }} output -json -state=$(find ${{ steps.vars.outputs.component_path }} -name terraform.tfstate) > output_values.json terraform-docs -c ${{ github.action_path }}/config/tfdocs-config.yaml --output-file ${{ github.workspace }}/atmos-apply-summary.md ./ From f5cfa10a3ef73e05aee5e3b7af465c00206c2a8c Mon Sep 17 00:00:00 2001 From: Igor Rodionov Date: Thu, 18 Jul 2024 04:12:22 +0300 Subject: [PATCH 10/12] Update action.yml --- action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/action.yml b/action.yml index 010ecff..5b7f5b8 100644 --- a/action.yml +++ b/action.yml @@ -334,7 +334,7 @@ runs: cat "${TERRAFORM_OUTPUT_FILE}" - ${{ steps.command.outputs.value }} output -json -state=$(find ${{ steps.vars.outputs.component_path }} -name terraform.tfstate) > output_values.json + TF_DATA_DIR=$(find ${{ steps.vars.outputs.component_path }} -name terraform.tfstate | dirname) ${{ steps.command.outputs.value }} output -json > output_values.json terraform-docs -c ${{ github.action_path }}/config/tfdocs-config.yaml --output-file ${{ github.workspace }}/atmos-apply-summary.md ./ From 13f4c2e578e3e82882b05898c3fb0f7b8f5b83f6 Mon Sep 17 00:00:00 2001 From: Igor Rodionov Date: Thu, 18 Jul 2024 04:36:00 +0300 Subject: [PATCH 11/12] Update action.yml --- action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/action.yml b/action.yml index 5b7f5b8..bcbffe0 100644 --- a/action.yml +++ b/action.yml @@ -334,7 +334,7 @@ runs: cat "${TERRAFORM_OUTPUT_FILE}" - TF_DATA_DIR=$(find ${{ steps.vars.outputs.component_path }} -name terraform.tfstate | dirname) ${{ steps.command.outputs.value }} output -json > output_values.json + TF_DATA_DIR=".terraform/plat" ${{ steps.command.outputs.value }} output -json > output_values.json terraform-docs -c ${{ github.action_path }}/config/tfdocs-config.yaml --output-file ${{ github.workspace }}/atmos-apply-summary.md ./ From 8e2c2416d1d2e70f5f5d7cefdaa0186ff434a162 Mon Sep 17 00:00:00 2001 From: Igor Rodionov Date: Thu, 18 Jul 2024 04:46:07 +0300 Subject: [PATCH 12/12] Update action.yml --- action.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/action.yml b/action.yml index bcbffe0..71d672b 100644 --- a/action.yml +++ b/action.yml @@ -333,9 +333,7 @@ runs: set -e cat "${TERRAFORM_OUTPUT_FILE}" - - TF_DATA_DIR=".terraform/plat" ${{ steps.command.outputs.value }} output -json > output_values.json - + atmos terraform output ${{ inputs.component }} --stack ${{ inputs.stack }} --skip-init -- -json 1> output_values.json terraform-docs -c ${{ github.action_path }}/config/tfdocs-config.yaml --output-file ${{ github.workspace }}/atmos-apply-summary.md ./ sed -i "s#\`\`#![Sensitive](https://img.shields.io/badge/sensitive-c40000?style=for-the-badge)#g" ${{ github.workspace }}/atmos-apply-summary.md