-
Notifications
You must be signed in to change notification settings - Fork 0
86 lines (83 loc) · 2.01 KB
/
terraform-ci.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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
name: Terraform CI
on:
push:
branches:
- main
- dev
pull_request:
jobs:
tflint:
name: Lint Terraform
runs-on: ubuntu-22.04
steps:
-
uses: actions/checkout@v3
name: Checkout source code
-
uses: terraform-linters/setup-tflint@v3
name: Setup TFLint
with:
tflint_version: v0.44.1
-
name: Show version
run: tflint --version
-
name: Init TFLint
run: tflint --init
env:
GITHUB_TOKEN: ${{ github.token }}
-
name: Run TFLint
run: tflint -f compact
format:
runs-on: ubuntu-22.04
name: Format Terraform
permissions:
contents: write
pull-requests: write
steps:
-
name: Checkout
uses: actions/checkout@v3
-
name: Run terraform fmt
uses: dflook/terraform-fmt@v1
-
name: Create Pull Request
uses: peter-evans/create-pull-request@v5
with:
commit-message: "🔨 Run `terraform fmt`"
title: 🔨 Reformat Terraform Files
body: Update Terraform files to canonical format using `terraform fmt`
branch: refactor/terraform-fmt
# Delete PR branch if diff is resolved anyhow
delete-branch: true
labels: |
bot
kind/cleanup
tfmermaid:
runs-on: ubuntu-22.04
name: Update Terraform Diagram
permissions:
contents: write
pull-requests: write
steps:
-
name: Checkout
uses: actions/checkout@v3
- uses: asannou/tfmermaid-action@v1
with:
file: README.md
-
name: Create Pull Request
uses: peter-evans/create-pull-request@v5
with:
commit-message: "📊 Generate Terraform diagrams using `tfmermaid`"
title: "📊 Generate Terraform Diagrams"
body: Update Terraform diagrams in README using `tfmermaid-action`
branch: refactor/tfmermaid
# Delete PR branch if diff is resolved anyhow
delete-branch: true
labels: |
bot
kind/cleanup