Description
Description
When following the monorepo documentation, I configure repo_dir = ".." to point from my package directory to the repository root. PSR then emits this warning:
WARNING:root:Found .git/ in higher parent directory rather than provided in configuration.
The warning is misleading because the configuration is correct—.. does resolve to the repository root.
Cause
In semantic_release/cli/config.py, the verify_git_repo_dir validator compares paths without resolving them:
if dir_path.absolute() != found_path:
logging.warning(...)Path("..").absolute() returns /path/to/package/.. rather than /path/to/repo, so the comparison fails even when both paths point to the same directory.
Suggested Fix
if dir_path.resolve() != found_path.resolve():Reproduction
Directory structure:
my-monorepo/ # .git/ here
├── package-a/
│ └── pyproject.toml # repo_dir = ".."
Commands:
cd package-a
semantic-release version --print
# WARNING:root:Found .git/ in higher parent directory...Documented Workflow
The monorepo guide instructs users to run PSR from the package subdirectory:
"To release a package, change your current working directory to the package directory and execute PSR's
semantic-release version."
In this workflow, the .git/ directory will always be in a parent directory. The warning contradicts the documented approach.
Environment
- python-semantic-release: 10.5.3
- Python: 3.12
- OS: Linux
Activity
H0R5E commentedon Jan 29, 2026
I have the same issue. I tried to configure
repo_dirbut to no avail.fix(config): resolve false .git/ warning for relative repo_dir
nfantone commentedon Apr 27, 2026
Run into the same today. Also, wanted to point out that
repo_dirdoesn't seem to be a documented configuration option.fix: use resolve() instead of absolute() in verify_git_repo_dir
fix: use resolve() instead of absolute() in verify_git_repo_dir
fix: use resolve() instead of absolute() in verify_git_repo_dir
fix(config): eliminate `.git/` in parent directory warnings for monor…
fix(config): eliminate `.git/` in parent directory warnings for monor…
fix(config): eliminate `.git/` in parent directory warnings for monor…
fix(config): eliminate `.git/` in parent directory warnings for monor…
fix(config): eliminate `.git/` in parent directory warnings for monor…
fix(config): eliminate `.git/` in parent dir warnings for monorepos c…
codejedi365 commentedon Jul 6, 2026
🎉 This issue has been resolved in v10.6.1 🎉
You can find more information about this release on the GitHub Releases page.
If your issue persists, please reply here and we will re-open the issue. If you receive a new error, please open a new issue and reference this issue there.