48 lines (43 loc) · 1.42 KB
/
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
41
42
43
44
45
46
47
48
name: terraform
on:
pull_request:
types: [opened, synchronize]
paths:
- .github/workflows/terraform.yml
- terraform/**
push:
branches:
- master
paths:
- .github/workflows/terraform.yml
- terraform/**
jobs:
terraform-check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4
- name: Terraform Format
uses: hashicorp/terraform-github-actions@b2ca17c0c25198c67c668c37edcbc45ca086a91e # v0.8.0
with:
tf_actions_version: 0.12.31
tf_actions_subcommand: fmt
tf_actions_working_dir: terraform/azure
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Terraform Init
uses: hashicorp/terraform-github-actions@b2ca17c0c25198c67c668c37edcbc45ca086a91e # v0.8.0
with:
tf_actions_version: 0.12.31
tf_actions_subcommand: init
tf_actions_working_dir: terraform/azure
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
TF_CLI_ARGS_init: -backend=false
- name: Terraform Validate
uses: hashicorp/terraform-github-actions@b2ca17c0c25198c67c668c37edcbc45ca086a91e # v0.8.0
with:
tf_actions_version: 0.12.31
tf_actions_subcommand: validate
tf_actions_working_dir: terraform/azure
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}