hashicorp / hashicorp/setup-terraform

Support resolving terraform version from config

Open
#407 8 comments 20 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
1.6k
Forks
288
Avg merge
23h 21m
Merged PRs (30d)
3

Description

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
terraform {
required_version = "1.3.6"
}
```

*action*
```yaml
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

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.