From dbf02b0c5e29e02ec80798b6ee3d9ebdfb2fe314 Mon Sep 17 00:00:00 2001 From: chris3ware <36608309+chris3ware@users.noreply.github.com> Date: Thu, 29 Aug 2024 13:51:53 +0100 Subject: [PATCH 1/2] test: add step to echo tf version --- .github/workflows/lint.yaml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml index 0fa0d7f..1032016 100644 --- a/.github/workflows/lint.yaml +++ b/.github/workflows/lint.yaml @@ -40,6 +40,10 @@ jobs: tfswitch --chdir=${{ inputs.terraform-dir }} terraform --version + - name: echo version + run: | + echo ${{ steps.tf-version.outputs.terraform_version }} + - name: Setup Tofu if: ${{ inputs.terraform-dir != '' }} uses: opentofu/setup-opentofu@ae80d4ecaab946d8f5ff18397fbf6d0686c6d46a # v1.0.3 From 3df08620eec59a0c1584ab1b0376731f0273cbd9 Mon Sep 17 00:00:00 2001 From: chris3ware <36608309+chris3ware@users.noreply.github.com> Date: Thu, 29 Aug 2024 13:59:08 +0100 Subject: [PATCH 2/2] fix(lint): Restore writing terraform to `GITHUB_ENV` The previous commit tested if a version was returned as an output, it wasn't, so this functionality has been restored. --- .github/workflows/lint.yaml | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml index 1032016..06846c6 100644 --- a/.github/workflows/lint.yaml +++ b/.github/workflows/lint.yaml @@ -38,17 +38,13 @@ jobs: id: tf-version run: | tfswitch --chdir=${{ inputs.terraform-dir }} - terraform --version - - - name: echo version - run: | - echo ${{ steps.tf-version.outputs.terraform_version }} + echo "TERRAFORM_VERSION=$(terraform --version -json | jq -r .terraform_version)" >> "$GITHUB_ENV" - name: Setup Tofu if: ${{ inputs.terraform-dir != '' }} uses: opentofu/setup-opentofu@ae80d4ecaab946d8f5ff18397fbf6d0686c6d46a # v1.0.3 with: - tofu_version: ${{ steps.tf-version.outputs.terraform_version }} + tofu_version: ${{ env.TERRAFORM_VERSION }} # Initialise terraform in the directory where terraform file have changed. - name: Initialise Tofu