-
Notifications
You must be signed in to change notification settings - Fork 88
61 lines (49 loc) · 1.39 KB
/
tf.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
name: 'Terraform'
defaults:
run:
shell: bash
working-directory: CHAP12/cert/
on:
push:
branches:
- main
permissions:
contents: read
jobs:
terraform:
runs-on: ubuntu-latest
name: Terraform
environment: dev
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install terraform-plan-summary
run: |
REPO="dineshba/terraform-plan-summary"
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: Setup Terraform
uses: hashicorp/setup-terraform@v2
with:
terraform_version: 1.4.6
terraform_wrapper: false
- name: Terraform Init
id: init
run: terraform init
- name: Terraform Plan
id: plan
run: terraform plan -input=false -no-color -out tf.plan
- name: summary in draw table format
run: |
rm -rf tf-summarize-table-output.md
terraform show -json tf.plan | tf-summarize -md > tf-summarize-table-output.md
- name: Adding markdown
run: |
cat tf-summarize-table-output.md > $GITHUB_STEP_SUMMARY
- name: Terraform Apply
run: terraform apply -input=false tf.plan