Skip to content

Commit fdd52cd

Browse files
committed
chore: post PR comment with tf-summarize on plan
1 parent 8161ed3 commit fdd52cd

1 file changed

Lines changed: 16 additions & 2 deletions

File tree

.github/workflows/terraform-plan.yml

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,9 @@ on:
88
- ".github/workflows/terraform-plan.yml"
99

1010
permissions:
11-
id-token: write
1211
contents: read
12+
id-token: write
13+
pull-requests: write
1314

1415
jobs:
1516
terraform-plan:
@@ -43,4 +44,17 @@ jobs:
4344
TF_VAR_CONTAINER_TAG: ${{ github.sha }}
4445
TF_VAR_DEVSECOPS_OBJECT_ID: ${{ secrets.TF_VAR_DEVSECOPS_OBJECT_ID }}
4546
TF_VAR_ENGINEERING_GROUP_OBJECT_ID: ${{ secrets.TF_VAR_ENGINEERING_GROUP_OBJECT_ID }}
46-
run: terraform plan -lock-timeout=5m
47+
run: terraform plan -out=tfplan -lock-timeout=5m
48+
49+
# tf-summarize generates a course-grained summary w/ no sensitive infra details
50+
- name: Setup tf-summarize
51+
uses: kishaningithub/setup-tf-summarize@1596bb06f9509eb36b71bc1b304407cc111059c0 #v3.0.0
52+
53+
- name: Create tf-summarize markdown file
54+
run: tf-summarize -md tfplan >> tf-summary.md
55+
56+
- name: Create PR comment with course-grained plan summary
57+
uses: peter-evans/create-or-update-comment@e8674b075228eee787fea43ef493e45ece1004c9 # v5.0.0
58+
with:
59+
issue-number: ${{ github.event.number }}
60+
body-path: "./terraform/tf-summary.md"

0 commit comments

Comments
 (0)