ci: install dependencies for pre-commit hooks
This commit is contained in:
parent
74a01b5b05
commit
8611f1d266
@ -44,11 +44,22 @@ jobs:
|
|||||||
ref: ${{ github.event.pull_request.head.sha }}
|
ref: ${{ github.event.pull_request.head.sha }}
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
|
|
||||||
- name: Install commitizen
|
- name: Install pre-commit
|
||||||
run: pip3 install pre-commit
|
run: pip3 install pre-commit
|
||||||
shell: bash
|
shell: bash
|
||||||
working-directory: ./
|
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
|
- name: Verify pre-commit status
|
||||||
run: pre-commit run --all
|
run: pre-commit run --all
|
||||||
shell: bash
|
shell: bash
|
||||||
|
@ -1,13 +1,14 @@
|
|||||||
repos:
|
repos:
|
||||||
- repo: https://github.com/antonbabenko/pre-commit-terraform
|
- repo: https://github.com/tofuutils/pre-commit-opentofu
|
||||||
rev: v1.94.1
|
rev: v1.0.2
|
||||||
hooks:
|
hooks:
|
||||||
- id: terraform_fmt
|
- id: tofu_fmt
|
||||||
- id: terraform_docs
|
- id: tofu_docs
|
||||||
args:
|
args:
|
||||||
- "--hook-config=--path-to-file=README.md"
|
- "--hook-config=--path-to-file=README.md"
|
||||||
- "--hook-config=--add-to-existing-file=true"
|
- "--hook-config=--add-to-existing-file=true"
|
||||||
- "--hook-config=--create-file-if-not-exist=true"
|
- "--hook-config=--create-file-if-not-exist=true"
|
||||||
|
- "--hook-config=--use-standard-markers=true"
|
||||||
- "--args=--escape=false"
|
- "--args=--escape=false"
|
||||||
- "--args=--lockfile=false"
|
- "--args=--lockfile=false"
|
||||||
- "--args=--indent 3"
|
- "--args=--indent 3"
|
||||||
|
Loading…
Reference in New Issue
Block a user