-
Notifications
You must be signed in to change notification settings - Fork 0
47 lines (37 loc) · 1.07 KB
/
terraform_graph.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
name: "Generate Terraform graph"
on:
workflow_call:
jobs:
terraform:
name: "Generate Terraform graph"
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
steps:
- name: Checkout
uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.ref }}
- name: test
run: pwd
- name: Setup Terraform
uses: hashicorp/[email protected]
with:
terraform_version: 1.3.7
terraform_wrapper: false
- name: Terraform Init
run: "terraform init -input=false -no-color"
- name: Install graphviz
run: "sudo apt-get install -y graphviz"
- name: Terraform Graph
id: graph
run: terraform graph > graph.dot
- name: Convert Graph to SVG
id: graph_convert
run: dot -Tsvg graph.dot > graph.svg
- name: Push changes back to PR branch
uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: "Update graph.svg"
file_pattern: graph.svg