-
Notifications
You must be signed in to change notification settings - Fork 1
52 lines (44 loc) · 1.21 KB
/
ci-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
49
50
51
52
name: Terraform CI
run-name: Terraform CI by @${{ github.actor }} ${{ github.sha }}
on:
workflow_dispatch:
pull_request:
types: [opened, synchronize, reopened]
push:
branches:
- main
paths:
- "!examples/**"
concurrency:
group: ${{ github.ref }}
cancel-in-progress: true
jobs:
terraform-ci:
name: Terraform CI
permissions:
pull-requests: write
contents: write
runs-on: ubuntu-latest
if: "!contains(github.event.head_commit.message, 'ci skip') && !contains(github.event.head_commit.message, 'skip ci')"
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.ref || github.ref }}
- uses: hashicorp/setup-terraform@v3
- name: Terraform Format
id: fmt
run: terraform fmt -check
continue-on-error: true
- name: Terraform Init
id: init
run: terraform init
- name: Terraform Validate
id: validate
run: terraform validate -no-color
- name: Terraform Docs
uses: terraform-docs/[email protected]
with:
working-dir: .
output-file: README.md
output-method: print
fail-on-diff: true