Skip to content

Instantly share code, notes, and snippets.

View jmd-au's full-sized avatar
🤖
beep boop

James Mac jmd-au

🤖
beep boop
View GitHub Profile
@jmd-au
jmd-au / terraform-plan-to-mr-comment.py
Last active March 4, 2025 02:30
Merge Request Terraform Plan Comment
import sys
import json
import re
def renderPlan():
structuredPlanFile = json.loads(open('./plan.json', 'r').read())
humanReadablePlan_file = str(open('./plan.txt', 'r').read())
return internalRenderPlan(structuredPlanFile, humanReadablePlan_file)
def internalRenderPlan(json_plan: dict, humanReadablePlan: list):