mirror of
https://github.com/opentofu/setup-opentofu.git
synced 2025-12-06 07:50:37 +00:00
chore: migrated terraformrc to tofurc
details: - https://github.com/opentofu/setup-opentofu/pull/2#discussion_r1347306740 - https://github.com/opentofu/setup-opentofu/pull/2#discussion_r1347357109 - https://github.com/opentofu/setup-opentofu/pull/2#discussion_r1347356063 Signed-off-by: Dmitry Kisler <admin@dkisler.com>
This commit is contained in:
parent
a8c9f4d930
commit
1add52fd80
4 changed files with 15 additions and 15 deletions
20
.github/workflows/setup-tofu.yml
vendored
20
.github/workflows/setup-tofu.yml
vendored
|
|
@ -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'
|
||||||
|
|
|
||||||
|
|
@ -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
4
dist/index.js
vendored
|
|
@ -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;
|
||||||
|
|
|
||||||
|
|
@ -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;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue