Skip to content

fix(purge): include Terragrunt cache targets - #1215

Merged
tw93 merged 2 commits into
tw93:mainfrom
ebbsanchez:codex/terragrunt-purge-cache
Jul 17, 2026
Merged

fix(purge): include Terragrunt cache targets#1215
tw93 merged 2 commits into
tw93:mainfrom
ebbsanchez:codex/terragrunt-purge-cache

Conversation

@ebbsanchez

Copy link
Copy Markdown

Summary

  • add .terragrunt-cache to the purge artifact target list
  • treat Terraform/Terragrunt files as project indicators so a configured single-project purge root can safely include its direct-child Terragrunt cache
  • add a purge regression test covering find-mode discovery from a Terragrunt project root

Fixes #1214.

Verification

  • ./scripts/check.sh
  • ./scripts/test.sh
  • manual bash probe confirming PURGE_TARGETS includes .terragrunt-cache, terragrunt.hcl marks the directory as a project root, and MO_USE_FIND=1 scan_purge_targets finds the cache directory

Note: this local machine does not have bats, shellcheck, shfmt, or Go installed, so the repo scripts skipped those tool-specific checks while still passing syntax, module loading, integration, and installation checks.

@ebbsanchez
ebbsanchez requested a review from tw93 as a code owner July 12, 2026 14:11
mole_purge_is_project_root matches indicators with [[ -e ]], which never
expands globs, so "*.tf" only half-worked (find paths yes, literal path
no). .terragrunt-cache only ever appears next to a terragrunt.hcl, so the
exact indicator is sufficient. Also realign the target list comments to
shfmt's output, which the Format check enforces.
@tw93
tw93 merged commit 57c1826 into tw93:main Jul 17, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEATURE] Clean terragrunt cache

3 participants