Skip to content

Commit 2538a9b

Browse files
authored
Ignore version changes to engine, also update CI (#13)
* add the feature, ignore old ci * new ci whodis
1 parent 46696f2 commit 2538a9b

16 files changed

+266
-155
lines changed

.github/workflows/pre-commit.yaml

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
name: pre-commit-check
33
on:
44
push:
5-
branches: -- main
5+
branches:
66
- master
77
- prod
88
- develop
@@ -16,14 +16,10 @@ jobs:
1616
uses: actions/setup-python@v2
1717
- name: Install prerequisites
1818
run: ./bin/install-ubuntu.sh
19-
- name: Setup Terraform
20-
uses: hashicorp/setup-terraform@v1
21-
with:
22-
terraform_version: ~> 0.12.29
2319
- name: initialize Terraform
2420
run: terraform init --backend=false
2521
- name: pre-commit
26-
uses: pre-commit/[email protected].0
22+
uses: pre-commit/[email protected].3
2723
env:
2824
AWS_DEFAULT_REGION: us-east-1
2925
# many of these are covered by better reviewdog linters below
@@ -32,12 +28,3 @@ jobs:
3228
no-commit-to-branch,
3329
terraform_tflint_nocreds,
3430
terraform_tfsec
35-
- uses: stefanzweifel/git-auto-commit-action@v4
36-
if: ${{ failure() }}
37-
with:
38-
commit_message: Apply automatic changes
39-
commit_options: "--no-verify"
40-
# Optional commit user and author settings
41-
commit_user_name: Linter Bot
42-
commit_user_email: [email protected]
43-
commit_author: Linter Bot <[email protected]>

.github/workflows/pullRequest.yaml

Lines changed: 6 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ on:
44
pull_request:
55

66
jobs:
7+
# TODO: #22 add job using https://github.com/reviewdog/action-alex
78
pre-commit:
89
runs-on: ubuntu-latest
910
steps:
@@ -12,14 +13,10 @@ jobs:
1213
uses: actions/setup-python@v2
1314
- name: Install prerequisites
1415
run: ./bin/install-ubuntu.sh
15-
- name: Setup Terraform
16-
uses: hashicorp/setup-terraform@v1
17-
with:
18-
terraform_version: ~> 0.12.29
1916
- name: initialize Terraform
2017
run: terraform init --backend=false
2118
- name: pre-commit
22-
uses: pre-commit/[email protected].0
19+
uses: pre-commit/[email protected].3
2320
env:
2421
AWS_DEFAULT_REGION: us-east-1
2522
# many of these are covered by better reviewdog linters below
@@ -28,23 +25,12 @@ jobs:
2825
no-commit-to-branch,
2926
terraform_tflint_nocreds,
3027
terraform_tfsec
31-
- uses: stefanzweifel/git-auto-commit-action@v4
32-
if: ${{ failure() }}
33-
with:
34-
commit_message: Apply automatic changes
35-
commit_options: "--no-verify"
36-
# Optional commit user and author settings
37-
commit_user_name: Linter Bot
38-
commit_user_email: [email protected]
39-
commit_author: Linter Bot <[email protected]>
4028
tflint:
4129
runs-on: ubuntu-latest
4230
steps:
4331
- uses: actions/checkout@v2
44-
- name: setup Terraform
45-
uses: hashicorp/setup-terraform@v1
46-
with:
47-
terraform_version: 0.12.26
32+
- name: Install prerequisites
33+
run: ./bin/install-ubuntu.sh
4834
- name: Terraform init
4935
run: terraform init --backend=false
5036
- name: tflint
@@ -59,10 +45,8 @@ jobs:
5945
runs-on: ubuntu-latest
6046
steps:
6147
- uses: actions/checkout@v2
62-
- name: setup Terraform
63-
uses: hashicorp/setup-terraform@v1
64-
with:
65-
terraform_version: 0.12.26
48+
- name: Install prerequisites
49+
run: ./bin/install-ubuntu.sh
6650
- name: Terraform init
6751
run: terraform init --backend=false
6852
- name: tfsec

.github/workflows/tflint.yaml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,8 @@ jobs:
1313
runs-on: ubuntu-latest
1414
steps:
1515
- uses: actions/checkout@v2
16-
- name: setup Terraform
17-
uses: hashicorp/setup-terraform@v1
18-
with:
19-
terraform_version: 0.12.26
16+
- name: Install prerequisites
17+
run: ./bin/install-ubuntu.sh
2018
- name: Terraform init
2119
run: terraform init --backend=false
2220
- name: tflint

.github/workflows/tfsec.yaml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,8 @@ jobs:
1313
runs-on: ubuntu-latest
1414
steps:
1515
- uses: actions/checkout@v2
16-
- name: setup Terraform
17-
uses: hashicorp/setup-terraform@v1
18-
with:
19-
terraform_version: 0.12.26
16+
- name: Install prerequisites
17+
run: ./bin/install-ubuntu.sh
2018
- name: Terraform init
2119
run: terraform init --backend=false
2220
- name: tfsec

.pre-commit-config.yaml

Lines changed: 26 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,11 @@
1+
exclude: ".terraform"
12
repos:
23
- repo: https://github.com/antonbabenko/pre-commit-terraform
3-
rev: v1.31.0
4+
rev: v1.77.1
45
hooks:
56
- id: terraform_docs
67
always_run: true
7-
args:
8-
- --args=--sort-by-required
98
- id: terraform_fmt
10-
- id: terraform_tflint
11-
alias: terraform_tflint_deep
12-
name: terraform_tflint_deep
13-
args:
14-
- --args=--deep
159
- id: terraform_tflint
1610
alias: terraform_tflint_nocreds
1711
name: terraform_tflint_nocreds
@@ -40,8 +34,29 @@ repos:
4034
verbose: true
4135
files: \.tf(vars)?$
4236
exclude: examples
37+
- id: tflock
38+
name: provider_locks
39+
entry: |
40+
bash -c '
41+
AWS_DEFAULT_REGION=us-east-1
42+
declare -a DIRS
43+
for FILE in "$@"
44+
do
45+
DIRS+=($(dirname "$FILE"))
46+
done
47+
for DIR in $(printf "%s\n" "${DIRS[@]}" | sort -u)
48+
do
49+
cd $(dirname "$FILE")
50+
terraform providers lock -platform=windows_amd64 -platform=darwin_amd64 -platform=linux_amd64
51+
cd ..
52+
done
53+
'
54+
language: system
55+
verbose: true
56+
files: \.tf(vars)?$
57+
exclude: examples
4358
- repo: https://github.com/pre-commit/pre-commit-hooks
44-
rev: v3.0.0
59+
rev: v4.4.0
4560
hooks:
4661
- id: check-case-conflict
4762
- id: check-json
@@ -70,3 +85,5 @@ repos:
7085
args:
7186
- --markdown-linebreak-ext=md
7287
exclude: README.md
88+
ci:
89+
skip: [terraform_docs, terraform_fmt, terraform_tflint, terraform_tfsec, tflock]

.terraform.lock.hcl

Lines changed: 45 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.tflint.hcl

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
config {
22
module = true
3-
deep_check = false
43
}
54

65
rule "terraform_deprecated_interpolation" {
@@ -37,7 +36,7 @@ rule "terraform_naming_convention" {
3736
}
3837

3938
rule "terraform_required_version" {
40-
enabled = true
39+
enabled = false
4140
}
4241

4342
rule "terraform_required_providers" {

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2020 Rhythmic Technologies, Inc.
3+
Copyright (c) 2023 Rhythmic Technologies, Inc.
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

0 commit comments

Comments
 (0)