Skip to content

support reading required_version from a terraform block in any file specified as tofu_version_file #81

@StephenWithPH

Description

@StephenWithPH

As documented:

The required_version setting accepts a version constraint string, which specifies which versions of OpenTofu can be used with your configuration.

If the running version of OpenTofu doesn't match the constraints specified, OpenTofu will produce an error and exit without taking any further actions.

It would be nice if users of this action could specify:

steps:
  - uses: opentofu/setup-opentofu@v1
    with:
      tofu_version_file: main.tf # or any other *.tf or *.tofu file

... where the specified file contains:

terraform {
  required_version = ">= 1.11.4, < 1.12"
  # other settings ...
}

... and have this action honor the value in required_version's version string in order to resolve which version of OpenTofu to set up.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions