From 99d716c62b514b9f0f6e6374503bc8b4c3af940d Mon Sep 17 00:00:00 2001 From: Bertrand Lanson Date: Sun, 8 Sep 2024 14:51:51 +0200 Subject: [PATCH] ci: install opentofu aswell for pre-commit --- .gitea/workflows/pull-request-open.yml | 26 +++++++++++++++++--------- 1 file changed, 17 insertions(+), 9 deletions(-) diff --git a/.gitea/workflows/pull-request-open.yml b/.gitea/workflows/pull-request-open.yml index 42046fb..fb459b7 100644 --- a/.gitea/workflows/pull-request-open.yml +++ b/.gitea/workflows/pull-request-open.yml @@ -23,7 +23,7 @@ jobs: - name: Install commitizen run: pip3 install commitizen shell: bash - working-directory: ./ + working-directory: ${{ gitea.workspace }} - run: git log origin/${{ github.event.pull_request.base.ref }}.. @@ -32,7 +32,7 @@ jobs: echo "cz check --rev-range origin/${{ gitea.event.pull_request.base.ref }}.." cz check --rev-range origin/${{ gitea.event.pull_request.base.ref }}.. shell: bash - working-directory: ./ + working-directory: ${{ gitea.workspace }} pre-commit-check: name: Check pre-commit status @@ -47,23 +47,31 @@ jobs: - name: Install pre-commit run: pip3 install pre-commit shell: bash - working-directory: ./ + working-directory: ${{ gitea.workspace }} - name: Install pre-commit dependencies run: | # terraform-docs curl -sSLo /tmp/terraform-docs.tar.gz \ - https://terraform-docs.io/dl/v0.18.0/terraform-docs-v0.18.0-$(uname)-amd64.tar.gz + https://terraform-docs.io/dl/${TERRAFORM_DOCS_VERSION}/terraform-docs-${TERRAFORM_DOCS_VERSION}-$(uname)-amd64.tar.gz tar -xzf /tmp/terraform-docs.tar.gz -C /tmp - ls -la - ls -la /tmp chmod +x /tmp/terraform-docs mv /tmp/terraform-docs /usr/local/bin/terraform-docs - rm -rf /tmp/terraform-docs* + rm -rf /tmp/* + + # opentofu + curl --proto '=https' --tlsv1.2 -fsSL https://get.opentofu.org/install-opentofu.sh \ + -o install-opentofu.sh + chmod +x install-opentofu.sh + ./install-opentofu.sh --install-method standalone --opentofu-version $OPENTOFU_VERSION + rm -f install-opentofu.sh shell: bash - working-directory: ./ + working-directory: ${{ gitea.workspace }} + env: + OPENTOFU_VERSION: 1.8.0 + TERRAFORM_DOCS_VERSION: v0.18.0 - name: Verify pre-commit status run: pre-commit run --all shell: bash - working-directory: ./ + working-directory: ${{ gitea.workspace }}