chore(ci): Use tool versions action to parse terraform version (#4076)

Extracted from feedback on #4049
This commit is contained in:
Jamil
2024-03-12 10:13:31 -07:00
committed by GitHub
parent 0f4348c406
commit eb01de0285
3 changed files with 15 additions and 15 deletions

View File

@@ -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 }}

View File

@@ -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: |

View File

@@ -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 }}