diff --git a/.github/workflows/setup-tofu.yml b/.github/workflows/setup-tofu.yml index 6de004e..29e2416 100644 --- a/.github/workflows/setup-tofu.yml +++ b/.github/workflows/setup-tofu.yml @@ -123,14 +123,14 @@ jobs: - name: Validate OpenTofu Credentials (Windows) if: runner.os == 'Windows' run: | - cat ${APPDATA}/terraform.rc | grep 'credentials "app.terraform.io"' - cat ${APPDATA}/terraform.rc | grep 'token = "${{ env.TF_CLOUD_API_TOKEN }}"' + cat ${APPDATA}/tofu.rc | grep 'credentials "app.terraform.io"' + cat ${APPDATA}/tofu.rc | grep 'token = "${{ env.TF_CLOUD_API_TOKEN }}"' - name: Validate Teraform Credentials (Linux & macOS) if: runner.os != 'Windows' run: | - cat ${HOME}/.terraformrc | grep 'credentials "app.terraform.io"' - cat ${HOME}/.terraformrc | grep 'token = "${{ env.TF_CLOUD_API_TOKEN }}"' + cat ${HOME}/.tofurc | grep 'credentials "app.terraform.io"' + cat ${HOME}/.tofurc | grep 'token = "${{ env.TF_CLOUD_API_TOKEN }}"' tofu-credentials-enterprise: name: 'OpenTofu Enterprise Credentials' @@ -153,14 +153,14 @@ jobs: - name: Validate OpenTofu Credentials (Windows) if: runner.os == 'Windows' run: | - cat ${APPDATA}/terraform.rc | grep 'credentials "tofu.example.com"' - cat ${APPDATA}/terraform.rc | grep 'token = "${{ env.TF_CLOUD_API_TOKEN }}"' + cat ${APPDATA}/tofu.rc | grep 'credentials "tofu.example.com"' + cat ${APPDATA}/tofu.rc | grep 'token = "${{ env.TF_CLOUD_API_TOKEN }}"' - name: Validate Teraform Credentials (Linux & macOS) if: runner.os != 'Windows' run: | - cat ${HOME}/.terraformrc | grep 'credentials "tofu.example.com"' - cat ${HOME}/.terraformrc | grep 'token = "${{ env.TF_CLOUD_API_TOKEN }}"' + cat ${HOME}/.tofurc | grep 'credentials "tofu.example.com"' + cat ${HOME}/.tofurc | grep 'token = "${{ env.TF_CLOUD_API_TOKEN }}"' tofu-credentials-none: name: 'OpenTofu No Credentials' @@ -178,12 +178,12 @@ jobs: - name: Validate OpenTofu Credentials (Windows) if: runner.os == 'Windows' run: | - [[ -f ${APPDATA}/terraform.rc ]] || exit 0 + [[ -f ${APPDATA}/tofu.rc ]] || exit 0 - name: Validate Teraform Credentials (Linux & macOS) if: runner.os != 'Windows' run: | - [[ -f ${HOME}/.terraformrc ]] || exit 0 + [[ -f ${HOME}/.tofurc ]] || exit 0 tofu-arguments: name: 'OpenTofu Arguments' diff --git a/README.md b/README.md index dc79bd0..21ff839 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ 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](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 OpenTofu commands.) diff --git a/dist/index.js b/dist/index.js index 4ae4071..9bc576d 100644 --- a/dist/index.js +++ b/dist/index.js @@ -180,8 +180,8 @@ credentials "${credentialsHostname}" { // default to OS-specific path let credsFile = osPlat === 'win32' - ? `${process.env.APPDATA}/terraform.rc` - : `${process.env.HOME}/.terraformrc`; + ? `${process.env.APPDATA}/tofu.rc` + : `${process.env.HOME}/.tofurc`; // override with TF_CLI_CONFIG_FILE environment variable credsFile = process.env.TF_CLI_CONFIG_FILE ? process.env.TF_CLI_CONFIG_FILE : credsFile; diff --git a/lib/setup-tofu.js b/lib/setup-tofu.js index 15dff56..158bdfd 100644 --- a/lib/setup-tofu.js +++ b/lib/setup-tofu.js @@ -105,8 +105,8 @@ credentials "${credentialsHostname}" { // default to OS-specific path let credsFile = osPlat === 'win32' - ? `${process.env.APPDATA}/terraform.rc` - : `${process.env.HOME}/.terraformrc`; + ? `${process.env.APPDATA}/tofu.rc` + : `${process.env.HOME}/.tofurc`; // override with TF_CLI_CONFIG_FILE environment variable credsFile = process.env.TF_CLI_CONFIG_FILE ? process.env.TF_CLI_CONFIG_FILE : credsFile;