Skip to content

Commit a2f0406

Browse files
committed
update checks
1 parent ae24688 commit a2f0406

File tree

3 files changed

+24
-1
lines changed

3 files changed

+24
-1
lines changed

.github/workflows/pre-commit-check.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ jobs:
3131
AWS_DEFAULT_REGION: us-east-1
3232
SKIP: terraform_tflint_deep
3333
- uses: stefanzweifel/git-auto-commit-action@v4
34+
if: ${{ failure() }}
3435
with:
3536
commit_message: Apply automatic changes
3637
commit_options: "--no-verify"

.pre-commit-config.yaml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ repos:
33
rev: v1.31.0
44
hooks:
55
- id: terraform_docs
6+
always_run: true
67
args:
78
- --args=--sort-by-required
89
- id: terraform_fmt
@@ -15,7 +16,28 @@ repos:
1516
alias: terraform_tflint_nocreds
1617
name: terraform_tflint_nocreds
1718
- id: terraform_tfsec
19+
- repo: local
20+
hooks:
1821
- id: terraform_validate
22+
name: terraform_validate
23+
entry: |
24+
bash -c '
25+
AWS_DEFAULT_REGION=us-east-1
26+
declare -a DIRS
27+
for FILE in "$@"
28+
do
29+
DIRS+=($(dirname "$FILE"))
30+
done
31+
for DIR in $(printf "%s\n" "${DIRS[@]}" | sort -u)
32+
do
33+
cd $(dirname "$FILE")
34+
terraform init --backend=false
35+
terraform validate .
36+
done
37+
'
38+
language: system
39+
verbose: true
40+
files: \.tf(vars)?$
1941
exclude: examples
2042
- repo: https://github.com/pre-commit/pre-commit-hooks
2143
rev: v3.0.0

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ module "cloudflare-restrictor" {
3434
|------|-------------|------|---------|:--------:|
3535
| allowed\_ports | Ports to allow traffic from CloudFlare on (recommended to only use 443) | `list(number)` | <pre>[<br> 443<br>]</pre> | no |
3636
| execution\_expression | cron expression for how frequently rules should be updated | `string` | `"rate(1 day)"` | no |
37-
| name | Moniker to apply to all resources in the module | `string` | `"cloudflare-restricter"` | no |
37+
| name | Moniker to apply to all resources in the module | `string` | `"cloudflare-restrictor"` | no |
3838
| tag\_key | Tag key to expect on security groups that will be managed by this module | `string` | `"CLOUDFLARE_MANAGED"` | no |
3939
| tag\_value | Tag value to expect on security groups that will be managed by this module | `string` | `"true"` | no |
4040
| tags | User-Defined tags | `map(string)` | `{}` | no |

0 commit comments

Comments
 (0)