Dmitry Kisler 2023-10-09 22:46:28 +02:00
parent a8c9f4d930
commit 1add52fd80
No known key found for this signature in database
GPG key ID: 46C0A987D58548F6
4 changed files with 15 additions and 15 deletions

View file

@ -123,14 +123,14 @@ jobs:
- name: Validate OpenTofu Credentials (Windows) - name: Validate OpenTofu Credentials (Windows)
if: runner.os == 'Windows' if: runner.os == 'Windows'
run: | run: |
cat ${APPDATA}/terraform.rc | grep 'credentials "app.terraform.io"' cat ${APPDATA}/tofu.rc | grep 'credentials "app.terraform.io"'
cat ${APPDATA}/terraform.rc | grep 'token = "${{ env.TF_CLOUD_API_TOKEN }}"' cat ${APPDATA}/tofu.rc | grep 'token = "${{ env.TF_CLOUD_API_TOKEN }}"'
- name: Validate Teraform Credentials (Linux & macOS) - name: Validate Teraform Credentials (Linux & macOS)
if: runner.os != 'Windows' if: runner.os != 'Windows'
run: | run: |
cat ${HOME}/.terraformrc | grep 'credentials "app.terraform.io"' cat ${HOME}/.tofurc | grep 'credentials "app.terraform.io"'
cat ${HOME}/.terraformrc | grep 'token = "${{ env.TF_CLOUD_API_TOKEN }}"' cat ${HOME}/.tofurc | grep 'token = "${{ env.TF_CLOUD_API_TOKEN }}"'
tofu-credentials-enterprise: tofu-credentials-enterprise:
name: 'OpenTofu Enterprise Credentials' name: 'OpenTofu Enterprise Credentials'
@ -153,14 +153,14 @@ jobs:
- name: Validate OpenTofu Credentials (Windows) - name: Validate OpenTofu Credentials (Windows)
if: runner.os == 'Windows' if: runner.os == 'Windows'
run: | run: |
cat ${APPDATA}/terraform.rc | grep 'credentials "tofu.example.com"' cat ${APPDATA}/tofu.rc | grep 'credentials "tofu.example.com"'
cat ${APPDATA}/terraform.rc | grep 'token = "${{ env.TF_CLOUD_API_TOKEN }}"' cat ${APPDATA}/tofu.rc | grep 'token = "${{ env.TF_CLOUD_API_TOKEN }}"'
- name: Validate Teraform Credentials (Linux & macOS) - name: Validate Teraform Credentials (Linux & macOS)
if: runner.os != 'Windows' if: runner.os != 'Windows'
run: | run: |
cat ${HOME}/.terraformrc | grep 'credentials "tofu.example.com"' cat ${HOME}/.tofurc | grep 'credentials "tofu.example.com"'
cat ${HOME}/.terraformrc | grep 'token = "${{ env.TF_CLOUD_API_TOKEN }}"' cat ${HOME}/.tofurc | grep 'token = "${{ env.TF_CLOUD_API_TOKEN }}"'
tofu-credentials-none: tofu-credentials-none:
name: 'OpenTofu No Credentials' name: 'OpenTofu No Credentials'
@ -178,12 +178,12 @@ jobs:
- name: Validate OpenTofu Credentials (Windows) - name: Validate OpenTofu Credentials (Windows)
if: runner.os == 'Windows' if: runner.os == 'Windows'
run: | run: |
[[ -f ${APPDATA}/terraform.rc ]] || exit 0 [[ -f ${APPDATA}/tofu.rc ]] || exit 0
- name: Validate Teraform Credentials (Linux & macOS) - name: Validate Teraform Credentials (Linux & macOS)
if: runner.os != 'Windows' if: runner.os != 'Windows'
run: | run: |
[[ -f ${HOME}/.terraformrc ]] || exit 0 [[ -f ${HOME}/.tofurc ]] || exit 0
tofu-arguments: tofu-arguments:
name: 'OpenTofu Arguments' name: 'OpenTofu Arguments'

View file

@ -3,7 +3,7 @@
The `opentofu/setup-opentofu` action sets up OpenTofu CLI in your GitHub Actions workflow by: 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`. - Downloading the latest version of OpenTofu CLI and adding it to the `PATH`.
- Configuring the [CLI configuration file](https://www.terraform.io/docs/commands/cli-config.html) with a Terraform Cloud/Enterprise hostname and API token. - Configuring the [CLI configuration file](https://opentofu.org/docs/cli/config/config-file/) with a Terraform Cloud/Enterprise hostname and API token.
- Installing a wrapper script to wrap subsequent calls of the `tofu` binary and expose its STDOUT, STDERR, and exit code as outputs named `stdout`, `stderr`, and `exitcode` respectively. (This can be optionally skipped if subsequent steps in the same job do not need to access the results of - Installing a wrapper script to wrap subsequent calls of the `tofu` binary and expose its STDOUT, STDERR, and exit code as outputs named `stdout`, `stderr`, and `exitcode` respectively. (This can be optionally skipped if subsequent steps in the same job do not need to access the results of
OpenTofu commands.) OpenTofu commands.)

4
dist/index.js vendored
View file

@ -180,8 +180,8 @@ credentials "${credentialsHostname}" {
// default to OS-specific path // default to OS-specific path
let credsFile = osPlat === 'win32' let credsFile = osPlat === 'win32'
? `${process.env.APPDATA}/terraform.rc` ? `${process.env.APPDATA}/tofu.rc`
: `${process.env.HOME}/.terraformrc`; : `${process.env.HOME}/.tofurc`;
// override with TF_CLI_CONFIG_FILE environment variable // override with TF_CLI_CONFIG_FILE environment variable
credsFile = process.env.TF_CLI_CONFIG_FILE ? process.env.TF_CLI_CONFIG_FILE : credsFile; credsFile = process.env.TF_CLI_CONFIG_FILE ? process.env.TF_CLI_CONFIG_FILE : credsFile;

View file

@ -105,8 +105,8 @@ credentials "${credentialsHostname}" {
// default to OS-specific path // default to OS-specific path
let credsFile = osPlat === 'win32' let credsFile = osPlat === 'win32'
? `${process.env.APPDATA}/terraform.rc` ? `${process.env.APPDATA}/tofu.rc`
: `${process.env.HOME}/.terraformrc`; : `${process.env.HOME}/.tofurc`;
// override with TF_CLI_CONFIG_FILE environment variable // override with TF_CLI_CONFIG_FILE environment variable
credsFile = process.env.TF_CLI_CONFIG_FILE ? process.env.TF_CLI_CONFIG_FILE : credsFile; credsFile = process.env.TF_CLI_CONFIG_FILE ? process.env.TF_CLI_CONFIG_FILE : credsFile;