mirror of
https://github.com/hashicorp/setup-terraform.git
synced 2025-12-16 16:42:35 +00:00
Add new-style readme build badges, bump actions/checkout in README.md examples (#188)
* Add new style workflow badges to `README.md` * `README.md` whitespace cleanup * Bump `actions/checkout@v3` in `README.md`
This commit is contained in:
parent
b3a43c3034
commit
1f367ab8a7
1 changed files with 21 additions and 29 deletions
26
README.md
26
README.md
|
|
@ -1,9 +1,7 @@
|
||||||
# setup-terraform
|
# setup-terraform
|
||||||
|
|
||||||
<p align="left">
|
[](https://github.com/hashicorp/setup-terraform/actions/workflows/continuous-integration.yml)
|
||||||
<a href="https://github.com/hashicorp/setup-terraform/actions"><img alt="Continuous Integration" src="https://github.com/hashicorp/setup-terraform/workflows/Continuous%20Integration/badge.svg" /></a>
|
[](https://github.com/hashicorp/setup-terraform/actions/workflows/setup-terraform.yml)
|
||||||
<a href="https://github.com/hashicorp/setup-terraform/actions"><img alt="Setup Terraform" src="https://github.com/hashicorp/setup-terraform/workflows/Setup%20Terraform/badge.svg" /></a>
|
|
||||||
</p>
|
|
||||||
|
|
||||||
The `hashicorp/setup-terraform` action is a JavaScript action that sets up Terraform CLI in your GitHub Actions workflow by:
|
The `hashicorp/setup-terraform` action is a JavaScript action that sets up Terraform CLI in your GitHub Actions workflow by:
|
||||||
|
|
||||||
|
|
@ -17,14 +15,14 @@ After you've used the action, subsequent steps in the same job can run arbitrary
|
||||||
|
|
||||||
This action can be run on `ubuntu-latest`, `windows-latest`, and `macos-latest` GitHub Actions runners. When running on `windows-latest` the shell should be set to Bash.
|
This action can be run on `ubuntu-latest`, `windows-latest`, and `macos-latest` GitHub Actions runners. When running on `windows-latest` the shell should be set to Bash.
|
||||||
|
|
||||||
The default configuration installs the latest version of Terraform CLI and installs the wrapper script to wrap subsequent calls to the `terraform` binary.
|
The default configuration installs the latest version of Terraform CLI and installs the wrapper script to wrap subsequent calls to the `terraform` binary:
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
steps:
|
steps:
|
||||||
- uses: hashicorp/setup-terraform@v2
|
- uses: hashicorp/setup-terraform@v2
|
||||||
```
|
```
|
||||||
|
|
||||||
A specific version of Terraform CLI can be installed.
|
A specific version of Terraform CLI can be installed:
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
steps:
|
steps:
|
||||||
|
|
@ -33,7 +31,7 @@ steps:
|
||||||
terraform_version: 1.1.7
|
terraform_version: 1.1.7
|
||||||
```
|
```
|
||||||
|
|
||||||
Credentials for Terraform Cloud ([app.terraform.io](https://app.terraform.io/)) can be configured.
|
Credentials for Terraform Cloud ([app.terraform.io](https://app.terraform.io/)) can be configured:
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
steps:
|
steps:
|
||||||
|
|
@ -61,8 +59,7 @@ steps:
|
||||||
terraform_wrapper: false
|
terraform_wrapper: false
|
||||||
```
|
```
|
||||||
|
|
||||||
Subsequent steps can access outputs when the wrapper script is installed.
|
Subsequent steps can access outputs when the wrapper script is installed:
|
||||||
|
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
steps:
|
steps:
|
||||||
|
|
@ -85,7 +82,7 @@ defaults:
|
||||||
run:
|
run:
|
||||||
working-directory: ${{ env.tf_actions_working_dir }}
|
working-directory: ${{ env.tf_actions_working_dir }}
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v3
|
||||||
- uses: hashicorp/setup-terraform@v2
|
- uses: hashicorp/setup-terraform@v2
|
||||||
|
|
||||||
- name: Terraform fmt
|
- name: Terraform fmt
|
||||||
|
|
@ -151,7 +148,7 @@ defaults:
|
||||||
run:
|
run:
|
||||||
working-directory: ${{ env.tf_actions_working_dir }}
|
working-directory: ${{ env.tf_actions_working_dir }}
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v3
|
||||||
- uses: hashicorp/setup-terraform@v2
|
- uses: hashicorp/setup-terraform@v2
|
||||||
|
|
||||||
- name: Terraform fmt
|
- name: Terraform fmt
|
||||||
|
|
@ -237,16 +234,13 @@ The action supports the following inputs:
|
||||||
|
|
||||||
- `cli_config_credentials_hostname` - (optional) The hostname of a Terraform Cloud/Enterprise instance to
|
- `cli_config_credentials_hostname` - (optional) The hostname of a Terraform Cloud/Enterprise instance to
|
||||||
place within the credentials block of the Terraform CLI configuration file. Defaults to `app.terraform.io`.
|
place within the credentials block of the Terraform CLI configuration file. Defaults to `app.terraform.io`.
|
||||||
|
|
||||||
- `cli_config_credentials_token` - (optional) The API token for a Terraform Cloud/Enterprise instance to
|
- `cli_config_credentials_token` - (optional) The API token for a Terraform Cloud/Enterprise instance to
|
||||||
place within the credentials block of the Terraform CLI configuration file.
|
place within the credentials block of the Terraform CLI configuration file.
|
||||||
|
|
||||||
- `terraform_version` - (optional) The version of Terraform CLI to install. Instead of a full version string,
|
- `terraform_version` - (optional) The version of Terraform CLI to install. Instead of a full version string,
|
||||||
you can also specify a constraint string (see [Semver Ranges](https://www.npmjs.com/package/semver#ranges)
|
you can also specify a constraint string (see [Semver Ranges](https://www.npmjs.com/package/semver#ranges)
|
||||||
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_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`.
|
||||||
|
|
@ -254,12 +248,10 @@ The action supports the following inputs:
|
||||||
## 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
|
||||||
to `true`, the following outputs are available for subsequent steps that call the `terraform` binary.
|
to `true`, the following outputs are available for subsequent steps that call the `terraform` binary:
|
||||||
|
|
||||||
- `stdout` - The STDOUT stream of the call to the `terraform` binary.
|
- `stdout` - The STDOUT stream of the call to the `terraform` binary.
|
||||||
|
|
||||||
- `stderr` - The STDERR stream of the call to the `terraform` binary.
|
- `stderr` - The STDERR stream of the call to the `terraform` binary.
|
||||||
|
|
||||||
- `exitcode` - The exit code of the call to the `terraform` binary.
|
- `exitcode` - The exit code of the call to the `terraform` binary.
|
||||||
|
|
||||||
## License
|
## License
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue