From c2f18714096a5b00489616324afa7892ec0d7544 Mon Sep 17 00:00:00 2001 From: Kate Case Date: Thu, 12 Dec 2024 12:06:34 -0500 Subject: [PATCH] Also look for git root if available. --- src/molecule/config.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/molecule/config.py b/src/molecule/config.py index d13cec64bb..a629a109bf 100644 --- a/src/molecule/config.py +++ b/src/molecule/config.py @@ -242,6 +242,11 @@ def collection_directory(self) -> Path | None: current_dir = Path(self.project_directory) if (current_dir / "galaxy.yml").exists(): return current_dir + show_toplevel = util.run_command("git rev-parse --show-toplevel") + if show_toplevel.returncode == 0: + git_root = Path(show_toplevel.stdout.strip()) + if (git_root / "galaxy.yml").exists(): + return git_root return None @property