TF-via-PR
TF-via-PR copied to clipboard
feat: add terragrunt functionality
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.yamlto automate Terragrunt plan/apply steps, including matrix jobs per target and error handling with troubleshooting and rollback steps.
Action Metadata and Messaging:
- Updated
action.ymlmetadata 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 forfmt,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.