-
Notifications
You must be signed in to change notification settings - Fork 38
64 lines (51 loc) · 1.88 KB
/
demo.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
53
54
55
56
57
58
59
60
61
62
63
64
name: Demo Workflow
on:
workflow_dispatch:
defaults:
run:
shell: bash
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set Terraform version
id: set-terraform-version
run: echo "terraform-version=$(cat example/.terraform-version)" >> $GITHUB_OUTPUT
- name: Setup Terraform
uses: hashicorp/setup-terraform@v2
with:
terraform_wrapper: false
terraform_version: ${{ steps.set-terraform-version.outputs.terraform-version }}
- name: Install terraform-plan-summary
run: |
REPO="dineshba/tf-summarize"
curl -LO https://github.com/$REPO/releases/latest/download/tf-summarize_linux_amd64.zip
tmpDir=$(mktemp -d -t tmp.XXXXXXXXXX)
mv tf-summarize_linux_amd64.zip $tmpDir
cd $tmpDir
unzip tf-summarize_linux_amd64.zip
chmod +x tf-summarize
echo $PWD >> $GITHUB_PATH
- name: Print tf-summarize version and help
run: |
tf-summarize -v
tf-summarize -h
- name: Terraform Init
run: terraform init
working-directory: ./example
- name: Terraform Plan
run: terraform plan -out=tfplan -refresh=false # -refresh=false is only for demo workflow
working-directory: ./example
- name: summary in table format
run: terraform show -json tfplan | tf-summarize
working-directory: ./example
- name: summary in tree format
run: terraform show -json tfplan | tf-summarize -tree
working-directory: ./example
- name: summary in separate tree format
run: terraform show -json tfplan | tf-summarize -separate-tree
working-directory: ./example
- name: summary in draw visual tree format
run: terraform show -json tfplan | tf-summarize -tree -draw
working-directory: ./example