forked from juice-shop/multi-juicer
-
-
Notifications
You must be signed in to change notification settings - Fork 12
56 lines (54 loc) · 1.82 KB
/
pre-commit.yml
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
47
48
49
50
51
52
53
54
55
56
name: Pre-commit check
# Controls when the workflow will run
on:
pull_request:
branches: [main]
workflow_dispatch:
env:
TF_DOCS_VERSION: v0.16.0
TFLINT_VERSION: v0.44.1
TF_VERSION: "1.3.4"
HELM_DOCS_VERSION: "1.11.0"
permissions:
contents: read
jobs:
pre-commit:
name: Pre-commit check
runs-on: ubuntu-latest
steps:
- name: Checkout git repository
uses: actions/checkout@v4
- name: Setup python
uses: actions/setup-python@v5
with:
python-version: "3.9"
- uses: actions/cache@v4
name: Cache plugin dir
with:
path: ~/.tflint.d/plugins
key: ${{ matrix.os }}-tflint-${{ hashFiles('.tflint.hcl') }}
- name: Setup Terraform
uses: hashicorp/setup-terraform@v3
with:
terraform_version: 1.1.7
- name: Setup TFLint
uses: terraform-linters/setup-tflint@v4
with:
tflint_version: ${{env.TFLINT_VERSION}}
- name: Setup Terraform docs
run: |
wget https://github.com/terraform-docs/terraform-docs/releases/download/${{env.TF_DOCS_VERSION}}/terraform-docs-${{env.TF_DOCS_VERSION}}-linux-amd64.tar.gz -O terraform_docs.tar.gz
tar -zxvf terraform_docs.tar.gz terraform-docs
chmod +x terraform-docs
mv terraform-docs /usr/local/bin/
- name: Setup helm-docs
run: |
cd /tmp
wget https://github.com/norwoodj/helm-docs/releases/download/v${{env.HELM_DOCS_VERSION}}/helm-docs_${{env.HELM_DOCS_VERSION}}_Linux_x86_64.tar.gz
tar -xvf helm-docs_${{env.HELM_DOCS_VERSION}}_Linux_x86_64.tar.gz
sudo mv helm-docs /usr/local/sbin
- name: Pre-commit checks
uses: pre-commit/[email protected]
- name: pre-commit-ci-lite
uses: pre-commit-ci/[email protected]
if: always()