opentofu / setup-opentofu

Mozilla Public License 2.0
79 stars 10 forks source link

[Feature Request] Enable getting version constraint from file #35

Open kittydoor opened 1 month ago

kittydoor commented 1 month ago
steps:
- uses: opentofu/setup-opentofu@v1
  with:
    tofu_version_file: ./.opentofu-version

Example similar action: https://github.com/actions/setup-go#getting-go-version-from-the-gomod-file

At the moment, you can cat the file and write the information from a file to GITHUB_OUTPUT in one job step, and in another setup-opentofu with version by referencing that output.

It would be a lot more convenient if it was possible to setup-opentofu in a single step by giving it the file location itself. There are two ways this can work.

A. My request: Use .opentofu-version file format (or .terraform-version, see tenv) B. Possible additional feature: Allow pointing to the file containing required_versions block (perhaps as tofu_version_block_file or something)

Option A is a lot simpler, and personally for me is all I need at the moment. Option B sounds like a good to have, and I imagine other people might require it.

Are these two feature requests acceptable to the maintainers? If there is a (decent quality) PR will it be merged?

cam72cam commented 3 weeks ago

I think we would be up for reviewing option A, thanks for proposing this!