diff --git a/.gitea/workflows/pull-request-open.yml b/.gitea/workflows/pull-request-open.yml index e8e4b99..47a66d7 100644 --- a/.gitea/workflows/pull-request-open.yml +++ b/.gitea/workflows/pull-request-open.yml @@ -44,11 +44,22 @@ jobs: ref: ${{ github.event.pull_request.head.sha }} fetch-depth: 0 - - name: Install commitizen + - name: Install pre-commit run: pip3 install pre-commit shell: bash working-directory: ./ + - 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 + tar -xzf /tmp/terraform-docs.tar.gz + chmod +x /tmp/terraform-docs + mv /tmp/terraform-docs /usr/local/bin/terraform-docs + shell: bash + working-directory: ./ + - name: Verify pre-commit status run: pre-commit run --all shell: bash diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 0035188..9752267 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,13 +1,14 @@ repos: - - repo: https://github.com/antonbabenko/pre-commit-terraform - rev: v1.94.1 + - repo: https://github.com/tofuutils/pre-commit-opentofu + rev: v1.0.2 hooks: - - id: terraform_fmt - - id: terraform_docs + - id: tofu_fmt + - id: tofu_docs args: - "--hook-config=--path-to-file=README.md" - "--hook-config=--add-to-existing-file=true" - "--hook-config=--create-file-if-not-exist=true" + - "--hook-config=--use-standard-markers=true" - "--args=--escape=false" - "--args=--lockfile=false" - "--args=--indent 3"