forked from clouddrove/github-shared-workflows
-
Notifications
You must be signed in to change notification settings - Fork 0
50 lines (42 loc) · 1.28 KB
/
Copy pathtf-lint.yml
File metadata and controls
50 lines (42 loc) · 1.28 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@v7
- name: 💾 Cache plugin dir
uses: actions/cache@v6
with:
path: ~/.tflint.d/plugins
key: ubuntu-latest-tflint-${{ hashFiles('.tflint.hcl') }}
- name: ⚙️ Setup TFLint
uses: terraform-linters/setup-tflint@v6
with:
tflint_version: v0.44.1
github_token: ${{ secrets.GITHUB }}
- name: 🛠️ Setup tflint-config
uses: terraform-linters/tflint-load-config-action@v3
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 }}
...