-
Notifications
You must be signed in to change notification settings - Fork 0
46 lines (38 loc) · 1.24 KB
/
pre-commit.yaml
File metadata and controls
46 lines (38 loc) · 1.24 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
name: Pre commit
on:
push:
jobs:
pre_commit_checks:
name: Pre-Commit checks
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@main
with:
submodules: true
- name: Generate fake ./terraform/live/secrets.auto.tfvars
run: cp terraform/live/secrets-sample.auto.tfvars terraform/live/secrets.auto.tfvars
# TODO: Cache plugins?
- uses: terraform-linters/setup-tflint@v5
name: Setup TFLint
with:
tflint_version: v0.52.0
- name: Install Terragrunt and OpenTofu
uses: gruntwork-io/terragrunt-action@v3
with:
# TODO: Use mise instead? https://github.com/gruntwork-io/terragrunt-action#tool-version-management
tg_version: 0.80.4
tofu_version: v1.10.5
- name: Initialize tofu without any backend
run: |
# Find all directories containing terragrunt.hcl
find . -type f -name "terragrunt.hcl" | while read hcl_file; do
dir=$(dirname "$hcl_file")
echo "Entering directory: $dir"
(
cd "$dir" || exit
tofu init -backend=false
)
done
- uses: pre-commit/action@main
env:
DISABLE_INIT: true