Skip to content
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

feat: support terraform_version_file #454

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

v1v
Copy link

@v1v v1v commented Dec 9, 2024

Closes #298 and #208

What

Add support for terraform_version_file input and keep the backward compatibility to use latest if both inputs are set or only terraform_version.

Why

Take advantage of the existing tools such as https://github.com/asdf-vm/asdf
Use a similar mechanism done in some other setup-<app> actions.

Similar PRs

I was blind, and I didn't see any references to them in the GH issues :/

@v1v v1v requested a review from a team as a code owner December 9, 2024 14:55
@v1v v1v changed the title docs: support terraform_version_file feat: support terraform_version_file Dec 9, 2024
Copy link

hashicorp-cla-app bot commented Dec 9, 2024

CLA assistant check
All committers have signed the CLA.

README.md Outdated

If the `terraform_version_file` input is specified, the action will extract the version from the file and install it.

Supported files names are `.tool-versions` or anything else.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We use .terraform-version which is a quasi-standard for Terraform: https://github.com/tfutils/tfenv?tab=readme-ov-file#terraform-version-file.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you mean replace or anything else. for .terraform-version?

I think keeping compatibility with https://github.com/asdf-vm/asdf by using .tool-versions is a good idea, for instance, some other GitHub actions use it:

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Java action also supports .java-version: https://github.com/actions/setup-java/blob/main/docs/advanced-usage.md.

I think it would be good to mention .terraform-version specifically because a lot of people are probably using it.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, see 149638b (#454)

@bbasata bbasata added the enhancement New feature or request label Feb 10, 2025
@v1v v1v requested a review from danielcompton February 27, 2025 20:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add support for .terraform-version file
3 participants