docs: support terraform_version_file

This commit is contained in:
Victor Martinez 2024-12-09 15:24:46 +01:00
parent 344fef46b6
commit 9b952973da
No known key found for this signature in database
GPG key ID: 3EF267DA33D65715

View file

@ -251,10 +251,24 @@ The action supports the following inputs:
for available range specifications). Examples are: `"<1.2.0"`, `"~1.1.0"`, `"1.1.7"` (all three installing for available range specifications). Examples are: `"<1.2.0"`, `"~1.1.0"`, `"1.1.7"` (all three installing
the latest available `1.1` version). Prerelease versions can be specified and a range will stay within the the latest available `1.1` version). Prerelease versions can be specified and a range will stay within the
given tag such as `beta` or `rc`. If no version is given, it will default to `latest`. given tag such as `beta` or `rc`. If no version is given, it will default to `latest`.
- `terraform_version_file` - (optional) The path to a file containing terraform version. Supported file types are `.terraform-version` and `.tool-versions`. See more details in [about version-file](#Terraform-version-file).
- `terraform_wrapper` - (optional) Whether to install a wrapper to wrap subsequent calls of - `terraform_wrapper` - (optional) Whether to install a wrapper to wrap subsequent calls of
the `terraform` binary and expose its STDOUT, STDERR, and exit code as outputs the `terraform` binary and expose its STDOUT, STDERR, and exit code as outputs
named `stdout`, `stderr`, and `exitcode` respectively. Defaults to `true`. named `stdout`, `stderr`, and `exitcode` respectively. Defaults to `true`.
### Terraform version file
If the `terraform_version_file` input is specified, the action will extract the version from the file and install it.
Supported files are `.terraform-version` and `.tool-versions`.
In `.terraform-version` file, the version should be specified as explainied in the `terraform_version` input.
In `.tool-versions` file, terraform version should be preceded by the terraform keyword (e.g., `terraform 1.13.0`).
The `.tool-versions` file supports version specifications in accordance with Semantic Versioning ([semver](https://semver.org/)) and [Semver Ranges](https://www.npmjs.com/package/semver#ranges).
If both `terraform_version` and `terraform_version_file` inputs are provided, the `terraform_version` input will be used.
If the file contains multiple versions, only the first one will be recognized.
## Outputs ## Outputs
This action does not configure any outputs directly. However, when you set the `terraform_wrapper` input This action does not configure any outputs directly. However, when you set the `terraform_wrapper` input