Skip to content

Commit 379cb0f

Browse files
authored
fix: tenv version and arch selection (#309)
* fix: tenv version and arch selection Signed-off-by: Rishav Dhar <19497993+rdhar@users.noreply.github.com> * set `tenv_version` Signed-off-by: Rishav Dhar <19497993+rdhar@users.noreply.github.com> * correct default arch reference Signed-off-by: Rishav Dhar <19497993+rdhar@users.noreply.github.com> * bump doc version Signed-off-by: Rishav Dhar <19497993+rdhar@users.noreply.github.com> --------- Signed-off-by: Rishav Dhar <19497993+rdhar@users.noreply.github.com>
1 parent 6cb2fda commit 379cb0f

File tree

3 files changed

+11
-3
lines changed

3 files changed

+11
-3
lines changed

.github/workflows/tf_tests.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ jobs:
5252
arg_command: ${{ github.event.pull_request.merged && 'apply' || 'plan' }}
5353
arg_lock: ${{ github.event.pull_request.merged && 'true' || 'false' }}
5454
arg_detailed_exitcode: true
55+
tenv_version: v3.2.3
5556
tf_tool: ${{ matrix.tool }}
5657
tf_version: ~> 1.8.0
5758

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,8 @@ In order to locally decrypt the TF plan file, use the following command (noting
121121
| `fmt_enable`</br>Default: `true` | Boolean flag to enable TF fmt command and display diff of changes. |
122122
| `label_pr`</br>Default: `true` | Boolean flag to add PR label of TF command to run. |
123123
| `plan_parity`</br>Default: `false` | Boolean flag to compare the TF plan file with a newly-generated one to prevent stale apply. |
124-
| `tenv_version`</br>Example: `v3.1.0` | String version tag of the tenv tool to install and use. |
124+
| `tenv_arch`</br>Default: `amd64` | String architecture of the tenv tool to install and use. |
125+
| `tenv_version`</br>Example: `v3.2.3` | String version tag of the tenv tool to install and use. |
125126
| `tf_tool`</br>Default: `terraform` | String name of the TF tool to use and override default assumption from wrapper environment variable. |
126127
| `tf_version`</br>Example: `~> 1.8.0` | String version constraint of the TF tool to install and use. |
127128
| `update_comment`</br>Default: `false` | Boolean flag to update existing PR comment instead of creating a new comment and deleting the old one. |

action.yml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,10 @@ inputs:
3232
description: Boolean flag to compare the TF plan file with a newly-generated one to prevent stale apply.
3333
required: false
3434
default: "false"
35+
tenv_arch:
36+
description: String architecture of the tenv tool to install and use.
37+
required: false
38+
default: "amd64"
3539
tenv_version:
3640
description: String version tag of the tenv tool to install and use.
3741
required: false
@@ -278,16 +282,18 @@ runs:
278282
- name: Install TF via tenv
279283
if: inputs.tf_version != ''
280284
env:
285+
TENV_ARCH: ${{ inputs.tenv_arch }}
281286
TENV_VERSION: ${{ inputs.tenv_version }}
282287
TF_TOOL: ${{ inputs.tf_tool }}
283288
TF_VERSION: ${{ inputs.tf_version }}
284289
shell: bash
285290
run: |
291+
# If $TENV_VERSION is not set, then retrieve the latest version.
286292
if [ -z "$TENV_VERSION" ]; then
287293
TENV_VERSION=$(curl --no-progress-meter --location https://api.github.com/repos/tofuutils/tenv/releases/latest | jq -r .tag_name)
288294
fi
289-
curl --remote-name --no-progress-meter --location "https://github.com/tofuutils/tenv/releases/latest/download/tenv_${TENV_VERSION}_amd64.deb"
290-
sudo dpkg --install "tenv_${TENV_VERSION}_amd64.deb"
295+
curl --remote-name --no-progress-meter --location "https://github.com/tofuutils/tenv/releases/download/${TENV_VERSION}/tenv_${TENV_VERSION}_${TENV_ARCH}.deb"
296+
sudo dpkg --install "tenv_${TENV_VERSION}_${TENV_ARCH}.deb"
291297
tenv "$TF_TOOL" install "$TF_VERSION"
292298
tenv update-path
293299

0 commit comments

Comments
 (0)