Skip to content

False "Found .git/ in higher parent directory" warning in monorepo setup #1418

Closed

Description

@sergeykad

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

  1. added
    bugSomething isn't working properly
    confirmedPrevent from becoming stale
    on Jan 13, 2026
  2. H0R5E commented on Jan 29, 2026

    @H0R5E
    Contributor

    I have the same issue. I tried to configure repo_dir but to no avail.

  3. added a commit that references this issue on Mar 21, 2026
    baa9a12
  4. nfantone commented on Apr 27, 2026

    @nfantone

    Run into the same today. Also, wanted to point out that repo_dir doesn't seem to be a documented configuration option.

  5. added 2 commits that reference this issue on May 9, 2026
    b1868fd
    bf5fdff
  6. added 6 commits that reference this issue on Jul 5, 2026
    46fe586
    a35990c
    e653b8a
    76e062f
    8f00e94
    434d24e
  7. added a commit that references this issue on Jul 6, 2026
    7a1f822
  8. codejedi365 commented on Jul 6, 2026

    @codejedi365
    Contributor

    🎉 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.

  9. removed
    bugSomething isn't working properly
    confirmedPrevent from becoming stale
    on Jul 6, 2026
  10. added theissue type on Jul 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    resolvedUsed when a bug has been fixed & released

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions