Skip to content

Commit

Permalink
fix: Remove default version of terraform if present on the host bef…
Browse files Browse the repository at this point in the history
…ore installing intended version (#12)
  • Loading branch information
bryantbiggs authored Oct 27, 2022
1 parent 0b21bc1 commit c734590
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
14 changes: 14 additions & 0 deletions .github/workflows/pre-commit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@ jobs:
- name: Checkout
uses: actions/checkout@v3

- name: Default Terraform version
continue-on-error: true
run: terraform version

- name: Terraform min/max versions
id: minMax
uses: clowdhaus/terraform-min-max@v1.0.8
Expand All @@ -57,6 +61,9 @@ jobs:
terraform-version: ${{ steps.minMax.outputs.minVersion }}
args: 'terraform_validate --color=always --show-diff-on-failure --files $(ls *.tf)'

- name: Selected Terraform version
run: terraform version

preCommitMaxVersion:
name: Max TF pre-commit
runs-on: ubuntu-latest
Expand All @@ -68,6 +75,10 @@ jobs:
ref: ${{ github.event.pull_request.head.ref }}
repository: ${{github.event.pull_request.head.repo.full_name}}

- name: Default Terraform version
continue-on-error: true
run: terraform version

- name: Terraform min/max versions
id: minMax
uses: clowdhaus/terraform-min-max@v1.0.8
Expand All @@ -82,3 +93,6 @@ jobs:

- name: check
run: hcledit --help

- name: Selected Terraform version
run: terraform version
1 change: 1 addition & 0 deletions pre-commit/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ runs:
- name: Install Terraform v${{ inputs.terraform-version }}
shell: bash
run: |
rm -rf $(which terraform)
curl -sSO https://releases.hashicorp.com/terraform/${{ inputs.terraform-version }}/terraform_${{ inputs.terraform-version }}_linux_amd64.zip
sudo unzip -qq terraform_${{ inputs.terraform-version }}_linux_amd64.zip terraform -d /usr/bin/
rm terraform_${{ inputs.terraform-version }}_linux_amd64.zip 2> /dev/null
Expand Down

0 comments on commit c734590

Please sign in to comment.