feat(tofu): add ability to specify required tofu version

This commit is contained in:
2024-06-21 20:59:59 +03:00
parent 917a4bc579
commit 5f603b24fa
2 changed files with 12 additions and 2 deletions

View File

@@ -1,6 +1,11 @@
name: tf-apply name: tf-apply
on: on:
workflow_call: workflow_call:
inputs:
tofu-version:
required: false
default: 1.7.1
type: string
secrets: secrets:
gpg-key: gpg-key:
required: true required: true
@@ -54,7 +59,7 @@ jobs:
- uses: opentofu/setup-opentofu@v1 - uses: opentofu/setup-opentofu@v1
if: ${{ steps.check.outputs.code == 2 }} if: ${{ steps.check.outputs.code == 2 }}
with: with:
tofu_version: 1.7.1 tofu_version: ${{ inputs.tofu-version }}
cli_config_credentials_token: ${{ secrets.tf-api-token }} cli_config_credentials_token: ${{ secrets.tf-api-token }}
- name: Decrypt secrets - name: Decrypt secrets
if: ${{ steps.check.outputs.code == 2 }} if: ${{ steps.check.outputs.code == 2 }}

View File

@@ -1,6 +1,11 @@
name: tf-plan name: tf-plan
on: on:
workflow_call: workflow_call:
inputs:
tofu-version:
required: false
default: 1.7.1
type: string
secrets: secrets:
gpg-key: gpg-key:
required: true required: true
@@ -23,7 +28,7 @@ jobs:
steps: steps:
- uses: opentofu/setup-opentofu@v1 - uses: opentofu/setup-opentofu@v1
with: with:
tofu_version: 1.7.1 tofu_version: ${{ inputs.tofu-version }}
cli_config_credentials_token: ${{ secrets.tf-api-token }} cli_config_credentials_token: ${{ secrets.tf-api-token }}
- name: Clone repo - name: Clone repo
uses: actions/checkout@v4 uses: actions/checkout@v4