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.