-
Notifications
You must be signed in to change notification settings - Fork 0
52 lines (43 loc) · 1.18 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
name: pre-commit
on:
workflow_dispatch:
pull_request:
branches:
- main
- master
env:
PYTHON_VERSION: "3.10"
TERRAFORM_DOCS_VERSION: "v0.16.0"
TFLINT_VERSION: "v0.45.0"
permissions:
contents: read
jobs:
pre-commit:
runs-on: ubuntu-22.04
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: ${{ env.PYTHON_VERSION }}
cache: pip
- name: Install Python dependencies
run: pip install -r requirements.txt
- name: Install terraform-docs
uses: jaxxstorm/[email protected]
with:
repo: terraform-docs/terraform-docs
tag: ${{ env.TERRAFORM_DOCS_VERSION }}
cache: enable
- name: TFLint cache
uses: actions/cache@v3
with:
path: ~/.tflint.d/plugins
key: ${{ runner.os }}-tflint-${{ hashFiles('.tflint.hcl') }}
- name: Install TFLint
uses: terraform-linters/setup-tflint@v2
with:
tflint_version: ${{ env.TFLINT_VERSION }}
- name: Run pre-commit
uses: pre-commit/[email protected]