-
Notifications
You must be signed in to change notification settings - Fork 49
51 lines (45 loc) · 1.29 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
45
46
47
48
49
50
51
name: terraform lint
on:
push:
branches:
- '**'
tags-ignore:
- '**'
paths:
- '.github/workflows/terraform-lint.yml'
- '**.tf'
- '**.tfvars'
- '**.tf.json'
- '**.tfvars.json'
# Manually triggered using GitHub's UI
workflow_dispatch:
jobs:
fmt:
runs-on: ubuntu-24.04
steps:
- name: Install Terraform
run: |
wget -O terraform.zip https://releases.hashicorp.com/terraform/1.10.2/terraform_1.10.2_linux_amd64.zip
unzip terraform.zip -d "$HOME/terraform"
echo "$HOME/terraform" >> "$GITHUB_PATH"
- uses: actions/checkout@v4
- run: scripts/terraform-fmt -check
validate:
name: validate ${{matrix.env}}
strategy:
matrix:
env:
- env/production
- env/testing
runs-on: ubuntu-24.04
steps:
- name: Install Terraform
run: |
wget -O terraform.zip https://releases.hashicorp.com/terraform/1.10.2/terraform_1.10.2_linux_amd64.zip
unzip terraform.zip -d "$HOME/terraform"
echo "$HOME/terraform" >> "$GITHUB_PATH"
- uses: actions/checkout@v4
- run: terraform init -backend=false
working-directory: ${{matrix.env}}
- run: terraform validate
working-directory: ${{matrix.env}}