Logic for listing all modules includes the test directories within modules, which fails the workflow and creates unnecessary entries in dependabot.yml.
Decided to use -maxdepth 2, which does enforce the folder structure somewhat, but that's already the case because the changed_modules list looks at modules/*/*/*.tf. So we can solve both of those together if we ever need to.
Alternatives I considered that don't work:
find modules -name main.tf -exec dirname {} \; - looks good but not every module has a main.tf
find modules -name README.md -exec dirname {} \; - the test folders have readme files too
Logic for listing all modules includes the test directories within modules, which fails the workflow and creates unnecessary entries in dependabot.yml.
Decided to use
-maxdepth 2
, which does enforce the folder structure somewhat, but that's already the case because thechanged_modules
list looks atmodules/*/*/*.tf
. So we can solve both of those together if we ever need to.Alternatives I considered that don't work:
find modules -name main.tf -exec dirname {} \;
- looks good but not every module has a main.tffind modules -name README.md -exec dirname {} \;
- the test folders have readme files too