TF-via-PR icon indicating copy to clipboard operation
TF-via-PR copied to clipboard

feat: add terragrunt functionality

Open rdhar opened this issue 3 months ago • 0 comments

This pull request adds first-class support for Terragrunt to the GitHub Action, enabling automated planning and application of Terragrunt-managed infrastructure alongside Terraform and OpenTofu. The changes include a new workflow for Terragrunt, updates to the action metadata and logic, and conditional handling throughout the composite action for Terragrunt-specific behavior.

Terragrunt Workflow Integration:

  • Added a new workflow file .github/workflows/test_terragrunt.yaml to automate Terragrunt plan/apply steps, including matrix jobs per target and error handling with troubleshooting and rollback steps.

Action Metadata and Messaging:

  • Updated action.yml metadata to reflect Terragrunt support in the name and description, and clarified messaging to refer to "infrastructure code" instead of just "TF code."

Composite Action Logic for Terragrunt:

  • Added Terragrunt-specific environment variable (TG_NON_INTERACTIVE) and conditional logic throughout the composite action to handle directory changes, command construction, and output processing for Terragrunt, including steps for fmt, init, validate, plan, show, and plan parity checks.

File Handling Adjustments:

  • Modified plan file naming conventions and unzip logic to account for Terragrunt's working directory requirements and plan file extension differences.

These changes collectively enable seamless Terragrunt support in PR-driven infrastructure automation workflows.

Fixes #258, #482.

rdhar avatar Nov 05 '25 20:11 rdhar