-
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
✨ feat(versionfile): accept versionfile #324
base: main
Are you sure you want to change the base?
Conversation
Hi @tush-tr 👋 Thank you for taking the time to create and submit this PR. We will need to discuss this change so that we can reach a product decision on whether the GitHub Action should accept a form of a “version” file. I have therefore marked this PR as requiring triage so that this can be discussed. |
@bendbennett just thought i would add 1 argument to supporting this feature
Granted the workaround is just |
); | ||
} | ||
|
||
version = await fs.readFile(versionFilePath, "utf-8"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note that this won't work if tfutils/tfenv#347 (allow whole line comments) is merged, and assuming of course that the user has the version file due to using tfenv
.
I say this mainly because I think it's an important consideration for the (Hashicorp) team in making a product decision about it as mentioned above: terraform
itself doesn't have a version file concept, so either:
setup-terraform
would support a simple 'just the version' format, and Hashicorp owns that format;- it tries to support all formats seen in the wild, on the basis of user reports that certain things (like comments) break it or something (and, er, hopes they never conflict?);
- it declares support for a specific format (e.g.
tfenv
's) and aims to support that (and inherently then breaking changes in that format necessitate breaking changes insetup-terraform
)
Added input support for terraform version file
Description
This pull request introduces a new feature to the setup-terraform action, allowing it to accept the Terraform version from a file. It addresses two previously opened issues: #208, #298. The feature enables users to specify the desired Terraform version through a
terraform_version_file
.Changes Made
Motivation
The motivation behind this feature is to provide more flexibility in specifying the Terraform version used within GitHub Action workflows. With the addition of this feature, users can define the Terraform version in a separate file, allowing for easier management and version control of the desired version across different workflows.
How to Use
To utilize this new feature, follow these steps:
terraform_version_file
to thesetup-terraform
action, specifying the path to the file containing the desired Terraform version.Example workflow configuration: