Skip to content

Support resolving terraform version from config #407

@dkirrane

Description

@dkirrane

I'm looking for a feature similar to actions/setup-go@v5 https://github.com/actions/setup-go?tab=readme-ov-file#getting-go-version-from-the-gomod-file

If we could pass a terraform-version-file that takes a path to a .tf file containing the terraform block with required_version e.g.

versions.tf

terraform {
  required_version = "1.3.6"
}

action

uses: hashicorp/setup-terraform@v3
with:
    terraform-version-file: 'path/to/versions.tf'

Or better still just automatically find the .tf file with required_version config

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