diff --git a/.github/workflows/_deploy_production.yml b/.github/workflows/_deploy_production.yml index 724bcf9cc..e4986a621 100644 --- a/.github/workflows/_deploy_production.yml +++ b/.github/workflows/_deploy_production.yml @@ -76,13 +76,13 @@ jobs: TF_API_TOKEN: "${{ secrets.TF_API_TOKEN }}" TF_WORKSPACE: "production" steps: - - name: Get Terraform Version - run: | - TERRAFORM_VERSION=$(cat .tool-versions | grep terraform | awk '{ print $NF; }') - echo "TERRAFORM_VERSION=${TERRAFORM_VERSION}" >> $GITHUB_ENV + - uses: actions/checkout@v4 + - name: Tool Versions + id: versions + uses: marocchino/tool-versions-action@v1.2.0 - uses: hashicorp/setup-terraform@v3 with: - terraform_version: ${{ env.TERRAFORM_VERSION }} + terraform_version: ${{ steps.versions.outputs.terraform }} - uses: actions/checkout@v4 with: ref: ${{ github.event.workflow_run.head_branch }} diff --git a/.github/workflows/_terraform.yml b/.github/workflows/_terraform.yml index ddff61418..fda62bc82 100644 --- a/.github/workflows/_terraform.yml +++ b/.github/workflows/_terraform.yml @@ -17,13 +17,13 @@ jobs: TF_API_TOKEN: "${{ secrets.TF_API_TOKEN }}" TF_WORKSPACE: "staging" steps: - - name: Get Terraform Version - run: | - TERRAFORM_VERSION=$(cat .tool-versions | grep terraform | awk '{ print $NF; }') - echo "TERRAFORM_VERSION=${TERRAFORM_VERSION}" >> $GITHUB_ENV + - uses: actions/checkout@v4 + - name: Tool Versions + id: versions + uses: marocchino/tool-versions-action@v1.2.0 - uses: hashicorp/setup-terraform@v3 with: - terraform_version: ${{ env.TERRAFORM_VERSION }} + terraform_version: ${{ steps.versions.outputs.terraform }} - uses: actions/checkout@v4 - name: Validate cloud-init run: | diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index 2a8a7558e..e45120051 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -41,13 +41,13 @@ jobs: TF_API_TOKEN: "${{ secrets.TF_API_TOKEN }}" TF_WORKSPACE: "staging" steps: - - name: Get Terraform Version - run: | - TERRAFORM_VERSION=$(cat .tool-versions | grep terraform | awk '{ print $NF; }') - echo "TERRAFORM_VERSION=${TERRAFORM_VERSION}" >> $GITHUB_ENV + - uses: actions/checkout@v4 + - name: Tool Versions + id: versions + uses: marocchino/tool-versions-action@v1.2.0 - uses: hashicorp/setup-terraform@v3 with: - terraform_version: ${{ env.TERRAFORM_VERSION }} + terraform_version: ${{ steps.versions.outputs.terraform }} - uses: actions/checkout@v4 with: ref: ${{ github.event.workflow_run.head_branch }}