-
Notifications
You must be signed in to change notification settings - Fork 5
44 lines (44 loc) · 1.06 KB
/
terraform-lint.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
---
name: Terraform Lint
on:
push:
branches:
- main
paths:
- "terraform/**"
pull_request:
branches:
- main
paths:
- "terraform/**"
workflow_dispatch:
inputs:
debug:
description: "Debug mode"
type: boolean
required: false
default: false
schedule:
- cron: "0 0 * * 1"
permissions:
contents: read
jobs:
tflint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
name: Checkout source code
- uses: actions/cache@v4
name: Cache plugin dir
with:
path: ~/.tflint.d/plugins
key: ubuntu-tflint-${{ hashFiles('.tflint.hcl') }}
- uses: terraform-linters/setup-tflint@v4
name: Setup TFLint
- name: Init TFLint
run: tflint --init
env:
# https://github.com/terraform-linters/tflint/blob/master/docs/user-guide/plugins.md#avoiding-rate-limiting
GITHUB_TOKEN: ${{ github.token }}
- name: Run TFLint
run: tflint --chdir terraform -f compact --recursive --color