generated from Fundacion-Instituto-Profesional-Duoc-UC/duoc-template
-
Notifications
You must be signed in to change notification settings - Fork 1
40 lines (31 loc) · 979 Bytes
/
terraform.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
name: Terraform Action
on:
workflow_call:
inputs:
path:
description: "Path to the Terraform code"
required: true
type: string
jobs:
terraform:
name: Terraform Checks
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v3
- name: Setup Terraform
uses: hashicorp/setup-terraform@v2
- name: Terraform Init
working-directory: ${{ inputs.path }}
run: terraform init
- name: Run Terraform FMT
run: terraform fmt -check -recursive ${{ inputs.path }}
- name: Run Terraform Validate
working-directory: ${{ inputs.path }}
run: terraform validate
- name: Install TFLint
run: |
curl -s https://raw.githubusercontent.com/terraform-linters/tflint/master/install_linux.sh | bash
- name: Run TFLint
working-directory: ${{ inputs.path }}
run: tflint --minimum-failure-severity=error