-
Notifications
You must be signed in to change notification settings - Fork 242
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Read terraform version from a .terraformrc file #208
Comments
I second this, but would prefer pulling from |
+1 specifically for |
I also believe |
👍 for the |
Really good idea, to use .terraform-version. Mostly because, .terraformrc is reserved for this use: https://www.terraform.io/cli/config/config-file - and this could create confusion |
It would be nice to have it in the setup action, but for now you can just do it this way:
|
@karelbemelmans that's a good workaround. I would propose a minor tweak to the version retrieval to allow comments in the file - name: Set variables
run: |
TF_VERSION=$(grep -vP '^[\s]?#' .terraform-version)
echo "TF_VERSION=$TF_VERSION" >> $GITHUB_ENV ✗ cat .terraform-version
# this is a good version
1.2.3
✗ grep -vP '^[\s]?#' .terraform-version
1.2.3 |
@karelbemelmans the spec for |
/assign |
Instead of hard coding the version in the workflow, it would be nice to have it read it from a file similar to how
actions/setup-node@v3
reads from.nvmrc
Something like this perhaps ?
The text was updated successfully, but these errors were encountered: