File tree Expand file tree Collapse file tree 2 files changed +23
-16
lines changed Expand file tree Collapse file tree 2 files changed +23
-16
lines changed Original file line number Diff line number Diff line change 1
1
name : lint
2
2
3
- on : [push, pull_request]
3
+ on :
4
+ pull_request :
5
+ push :
6
+ branches :
7
+ - main
4
8
5
9
jobs :
6
10
build :
7
11
8
12
runs-on : ubuntu-latest
9
13
10
14
steps :
11
- - uses : actions/checkout@v1
12
- - name : Run pre-commit test
15
+ - uses : actions/checkout@v3
16
+ - uses : actions/setup-python@v4
17
+ with :
18
+ python-version : 3.x
19
+ - name : Install pre-commit dependency - terraform-docs
13
20
run : |
14
- sudo apt-get install python3-pip gawk
15
- curl https://pre-commit.com/install-local.py | python3 -
16
- # Terraform Docs
17
- curl -Lo ./terraform-docs https://github.com/terraform-docs/terraform-docs/releases/download/v0.9.1/terraform-docs-v0.9.1-$(uname | tr '[:upper:]' '[:lower:]')-amd64
18
- chmod +x ./terraform-docs
19
- sudo mv ./ terraform-docs /usr/bin/terraform-docs
20
- # Tflint
21
- curl -L "$(curl -s https://api.github.com/repos/terraform-linters/tflint/releases/latest | grep -o -E "https://.+?_linux_amd64.zip")" > tflint.zip && unzip tflint.zip && rm tflint.zip && sudo mv tflint /usr/bin/
22
- # Run pre-commit
23
- /home/runner/bin/ pre-commit --version
24
- terraform-docs --version
25
- /home/runner/bin/pre-commit run -a
21
+ TF_DOCS_VER="v0.9.1"
22
+ pushd /tmp
23
+ curl -Lo ./terraform-docs https://github.com/terraform-docs/terraform-docs/releases/download/${TF_DOCS_VER}/terraform-docs-${TF_DOCS_VER}-$(uname | tr '[:upper:]' '[:lower:]')-amd64 && chmod +x ./terraform-docs && sudo mv ./terraform-docs /usr/bin/
24
+ popd
25
+ - name : Install pre-commit dependency - tflint
26
+ uses : terraform-linters/setup-tflint@v2
27
+ with :
28
+ tflint_version : v0.34.0
29
+ - name : Run pre-commit test
30
+ uses : pre-commit/action@v3.0.0
31
+ with :
32
+ extra_args : --all-files
Original file line number Diff line number Diff line change 1
1
repos :
2
- - repo : git ://github.com/antonbabenko/pre-commit-terraform
2
+ - repo : https ://github.com/antonbabenko/pre-commit-terraform
3
3
rev : v1.43.0
4
4
hooks :
5
5
- id : terraform_fmt
You can’t perform that action at this time.
0 commit comments