diff --git a/server/events/pending_plan_finder.go b/server/events/pending_plan_finder.go index 8dd818104f..6818c4bbe1 100644 --- a/server/events/pending_plan_finder.go +++ b/server/events/pending_plan_finder.go @@ -62,6 +62,11 @@ func (p *DefaultPendingPlanFinder) findWithAbsPaths(pullDir string) ([]PendingPl } for _, file := range strings.Split(string(lsOut), "\n") { if filepath.Ext(file) == ".tfplan" { + // Ignore .terragrunt-cache dirs (#487) + if strings.Contains(file, ".terragrunt-cache/") { + continue + } + repoRelDir := filepath.Dir(file) plans = append(plans, PendingPlan{ RepoDir: repoDir, diff --git a/server/events/pending_plan_finder_test.go b/server/events/pending_plan_finder_test.go index 13c36a48cd..6fb86b29a6 100644 --- a/server/events/pending_plan_finder_test.go +++ b/server/events/pending_plan_finder_test.go @@ -139,6 +139,30 @@ func TestPendingPlanFinder_Find(t *testing.T) { }, }, }, + { + ".terragrunt-cache", + map[string]interface{}{ + "default": map[string]interface{}{ + ".terragrunt-cache": map[string]interface{}{ + "N6lY9xk7PivbOAzdsjDL6VUFVYk": map[string]interface{}{ + "K4xpUZI6HgUF-ip6E1eib4L8mwQ": map[string]interface{}{ + "app": map[string]interface{}{ + "default.tfplan": nil, + }, + }, + }, + }, + "default.tfplan": nil, + }, + }, + []events.PendingPlan{ + { + RepoDir: "???/default", + RepoRelDir: ".", + Workspace: "default", + }, + }, + }, } pf := &events.DefaultPendingPlanFinder{}