Skip to content

Commit

Permalink
Add a test for required_version with a v prefix
Browse files Browse the repository at this point in the history
  • Loading branch information
dflook committed May 28, 2024
1 parent 3735a7a commit eecd5ca
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
23 changes: 23 additions & 0 deletions .github/workflows/test-version.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,29 @@ jobs:
exit 1
fi
required_version_v_prefix:
runs-on: ubuntu-latest
name: required_version with a v prefix
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Test terraform-version
uses: ./terraform-version
id: terraform-version
with:
path: tests/workflows/test-version/v-prefix

- name: Print the version
run: echo "The terraform version was ${{ steps.terraform-version.outputs.terraform }}"

- name: Check the version
run: |
if [[ "${{ steps.terraform-version.outputs.terraform }}" != "0.12.26" ]]; then
echo "::error:: Terraform version not set from required_version range"
exit 1
fi
tfswitch:
runs-on: ubuntu-latest
name: tfswitch
Expand Down
3 changes: 3 additions & 0 deletions tests/workflows/test-version/v-prefix/main.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
terraform {
required_version = "<= v0.12.26"
}

0 comments on commit eecd5ca

Please sign in to comment.