Repository navigation
50 lines (42 loc) · 1.46 KB
/
Copy pathtf-lint.yml
File metadata and controls
50 lines (42 loc) · 1.46 KB
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
---
# 🧪 Tflint workflow checks for possible errors, and best practices in your terraform code
name: tf-lint
on:
workflow_call:
secrets:
GITHUB:
required: true
description: 'PAT of the user to run the jobs.'
jobs:
tflint:
runs-on: ubuntu-latest
steps:
- name: 📦 Checkout Repository
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: 💾 Cache plugin dir
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
with:
path: ~/.tflint.d/plugins
key: ubuntu-latest-tflint-${{ hashFiles('.tflint.hcl') }}
- name: ⚙️ Setup TFLint
uses: terraform-linters/setup-tflint@1cf010d3c7aef302051ccdb68c14c5dc2efa34ef # v6.3.1
with:
tflint_version: v0.44.1
github_token: ${{ secrets.GITHUB }}
- name: 🛠️ Setup tflint-config
uses: terraform-linters/tflint-load-config-action@32d9f74138340b95873e956fbdfc390db819bff1 # v3.0.0
with:
source-repo: clouddrove/github-shared-workflows
source-path: .github/config/.tflint.hcl
source-ref: master
- name: 🔍 Show version
run: tflint --version
- name: 🚀 Init lint
run: tflint --init
env:
GITHUB_TOKEN: ${{ github.token }}
- name: ✅ Run lint
run: tflint --recursive --color --force -f compact
env:
GITHUB_TOKEN: ${{ github.token }}
...