-
Notifications
You must be signed in to change notification settings - Fork 1
34 lines (32 loc) · 997 Bytes
/
terraform.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
---
name: Terraform
on:
workflow_call:
inputs:
terraform_version:
description: 'The version of Terraform CLI to install'
default: 'latest'
required: false
type: string
working_dir:
description: 'Switch to a different working directory before executing the given subcommand'
default: '.'
required: false
type: string
jobs:
terraform:
name: Validate Terraform
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Terraform
uses: hashicorp/setup-terraform@v2.0.3
with:
terraform_version: ${{ inputs.terraform_version }}
- name: Terraform Format
run: terraform -chdir=${{ inputs.working_dir }} fmt -check -diff
- name: Terraform Init
run: terraform -chdir=${{ inputs.working_dir }} init
- name: Terraform Validate
run: terraform -chdir=${{ inputs.working_dir }} validate -no-color