ci: install dependencies for pre-commit hooks
Some checks failed
development / Check commit compliance (push) Successful in 5s
pull-requests-open / Check commit compliance (pull_request) Successful in 5s
pull-requests-open / Check pre-commit status (pull_request) Failing after 6s

This commit is contained in:
Bertrand Lanson 2024-09-08 14:44:01 +02:00
parent 74a01b5b05
commit 8611f1d266
Signed by: lanson
SSH Key Fingerprint: SHA256:/nqc6HGqld/PS208F6FUOvZlUzTS0rGpNNwR5O2bQBw
2 changed files with 17 additions and 5 deletions

View File

@ -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

View File

@ -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"