-
Notifications
You must be signed in to change notification settings - Fork 12
45 lines (45 loc) · 1.56 KB
/
tflint.yaml
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
name: Terraform Linter
on: [pull_request]
jobs:
linter:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Check if Terraform files changed
id: terraform-changes
uses: tj-actions/changed-files@4edd678ac3f81e2dc578756871e4d00c19191daf # v45
with:
files: |
terraform/**
- name: Tailscale
if: steps.terraform-changes.outputs.any_changed == 'true'
uses: tailscale/github-action@v2
with:
oauth-client-id: ${{ secrets.TS_OAUTH_CLIENT_ID }}
oauth-secret: ${{ secrets.TS_OAUTH_SECRET }}
tags: tag:clients
- name: Clone repo
if: steps.terraform-changes.outputs.any_changed == 'true'
uses: actions/checkout@master
- name: Install Terraform
if: steps.terraform-changes.outputs.any_changed == 'true'
run: |
curl iac.sh/terraform > getinst.sh && \
bash getinst.sh
- name: Terraform init
if: steps.terraform-changes.outputs.any_changed == 'true'
run: |
cd terraform && \
terraform init -upgrade -backend-config="conn_str=${{ secrets.tf_con_string }}"
- name: tflint
if: steps.terraform-changes.outputs.any_changed == 'true'
uses: reviewdog/action-tflint@master
with:
github_token: ${{ secrets.github_token }}
working_directory: "terraform"
reporter: github-pr-review
fail_on_error: "true"
flags: "--module"
filter_mode: "nofilter"