|
|
||
|---|---|---|
| .github | ||
| .husky | ||
| dist | ||
| lib | ||
| wrapper | ||
| .gitignore | ||
| action.yml | ||
| CHANGELOG.md | ||
| CODE_OF_CONDUCT.md | ||
| CODEOWNERS | ||
| index.js | ||
| LICENSE | ||
| package-lock.json | ||
| package.json | ||
| README.md | ||
setup-opentofu
The opentofu/setup-opentofu action sets up OpenTofu CLI in your GitHub Actions workflow by:
- Downloading the latest version of OpenTofu CLI and adding it to the
PATH. - Configuring the CLI configuration file with a Terraform Cloud/Enterprise hostname and API token.
- Installing a wrapper script to wrap subsequent calls of the
tofubinary and expose its STDOUT, STDERR, and exit code as outputs namedstdout,stderr, andexitcoderespectively. (This can be optionally skipped if subsequent steps in the same job do not need to access the results of OpenTofu commands.)
After you've used the action, subsequent steps in the same job can run arbitrary OpenTofu commands using the GitHub Actions run syntax. This allows most OpenTofu commands to work exactly
like they do on your local command line.
Usage
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 OpenTofu CLI and installs the wrapper script to wrap subsequent calls to the tofu binary:
steps:
- uses: opentofu/setup-opentofu
Inputs
The action supports the following inputs:
cli_config_credentials_hostname- (optional) The hostname of a Terraform Cloud/Enterprise instance to place within the credentials block of the OpenTofu CLI configuration file. Defaults toapp.terraform.io.cli_config_credentials_token- (optional) The API token for a Terraform Cloud/Enterprise instance to place within the credentials block of the OpenTofu CLI configuration file.tofu_version- (optional) The version of OpenTofu CLI to install. If no version is given, it will default tolatest.tofu_wrapper- (optional) Whether to install a wrapper to wrap subsequent calls of thetofubinary and expose its STDOUT, STDERR, and exit code as outputs namedstdout,stderr, andexitcoderespectively. Defaults totrue.
Outputs
This action does not configure any outputs directly. However, when you set the tofu_wrapper input
to true, the following outputs are available for subsequent steps that call the tofu binary:
stdout- The STDOUT stream of the call to thetofubinary.stderr- The STDERR stream of the call to thetofubinary.exitcode- The exit code of the call to thetofubinary.
License
Code of Conduct
Experimental Status
By using the software in this repository (the "Software"), you acknowledge that: (1) the Software is still in development, may change, and has not been released as a commercial product by OpenTofu; (2) the Software is provided on an "as-is" basis, and may include bugs, errors, or other issues; (3) the Software is NOT INTENDED FOR PRODUCTION USE, use of the Software may result in unexpected results, loss of data, or other unexpected results, and OpenTofu disclaims any and all liability resulting from use of the Software.