Sometimes specifying every project in digger.yml by hand is suboptimal, especially with a large number of small statefiles. In this scenario you can use the generate_projects directive in digger.yml. Digger will then traverse the directory according to include_patters and exclude_patterns provided and dynamically generate the list of projects

generate_projects:
  include: "projects/dev/*"
  exclude: "projects/dev/test3"

Blocks syntax

You can also specify multiple include / exclude entries like this:

generate_projects:
  blocks:
    - include: "environments/core/**"
      workflow: default_work_flow
    - include: "environments/cicd/**"
      workflow: default_work_flow
    - include: "environments/dev/**"
      workflow: default_work_flow
    - include: "environments/qa/**"
      workflow: default_work_flow

Demo repo

Traversing nested directories

You can optionally set the top-level argument traverse_to_nested_projects to generate a project for all sub-directories:

traverse_to_nested_projects: true
generate_projects:
  blocks:
    - include: "environments/core/**"

This will create a project for all sub-directories under environments/core. If set to false, only the first directory with a .tf file will be evaluated.