From 7d9f03bc5ede35bf7cb97827d5149d57ada5fcb6 Mon Sep 17 00:00:00 2001 From: Tanner Doshier Date: Tue, 24 Dec 2024 15:59:15 -0500 Subject: [PATCH] Fix custom setup-terraform usage in `template-only-ci-infra.yml` --- .github/actions/setup-terraform/action.yml | 12 ++++++++---- .github/workflows/template-only-ci-infra.yml | 4 +++- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/.github/actions/setup-terraform/action.yml b/.github/actions/setup-terraform/action.yml index cd09f02d1..80d17aef7 100644 --- a/.github/actions/setup-terraform/action.yml +++ b/.github/actions/setup-terraform/action.yml @@ -1,12 +1,16 @@ -name: 'Set up Terraform' -description: 'Set up Terraform with the version stored in the .terraform-version file' +name: "Set up Terraform" +description: "Set up Terraform with the version stored in the .terraform-version file" +inputs: + version-file: + description: "File containing the terraform version to use." + default: ".terraform-version" runs: using: "composite" steps: - - name: Get .terraform-version + - name: Get Terraform version id: get-terraform-version run: | - terraform_version="$(cat .terraform-version)" + terraform_version="$(cat ${{ inputs.version-file }})" echo "Terraform version: ${terraform_version}" echo "terraform_version=${terraform_version}" >> "$GITHUB_OUTPUT" shell: bash diff --git a/.github/workflows/template-only-ci-infra.yml b/.github/workflows/template-only-ci-infra.yml index 967e03b60..9c77738f9 100644 --- a/.github/workflows/template-only-ci-infra.yml +++ b/.github/workflows/template-only-ci-infra.yml @@ -38,7 +38,9 @@ jobs: path: template-infra - name: Set up Terraform - uses: ./.github/actions/setup-terraform + uses: ./template-infra/.github/actions/setup-terraform + with: + version-file: ./template-infra/.terraform-version - uses: actions/setup-go@v5 with: