johncblandii
04/06/2023, 2:32 PM.pre-commit-config.yaml
repos:
- repo: https://github.com/google/yamlfmt
rev: v0.9.0
hooks:
- id: yamlfmt
- repo: https://github.com/antonbabenko/pre-commit-terraform
rev: v1.77.1
hooks:
- id: terraform_fmt
- id: terraform_docs
args: ["--args=--lockfile=false"]
.yamlfmt
formatter:
type: basic
retain_line_breaks: true
indentless_arrays: false
drop_merge_tag: true
GHA in threadjohncblandii
04/06/2023, 2:33 PM- uses: actions/setup-go@v4
with:
go-version: "1.18.0"
- run: go install github.com/google/yamlfmt/cmd/yamlfmt@latest
- uses: actions/setup-python@v3
with:
python-version: 2.x
token: ${{ secrets.GHA_SERVICE_ACCOUNT_TOKEN }}
# pre-commit checks: fmt + terraform-docs
# We skip tf_validate as it requires an init
# of all root modules, which is to be avoided.
- uses: cloudposse/github-action-pre-commit@v3.0.0
env:
SKIP: tf_validate
with:
token: ${{ secrets.GHA_SERVICE_ACCOUNT_TOKEN }}
git_user_name: ${{ secrets.GHA_SERVICE_ACCOUNT_USER_NAME }}
git_user_email: ${{ secrets.GHA_SERVICE_ACCOUNT_USER_EMAIL }}
git_commit_message: "chore(pre-commit): linting"
extra_args: --all-filesjohncblandii
04/06/2023, 2:33 PMsetup-go and go install ....)