Skip to content

Fix local_archive strategy to use git root directory for archive#4168

Merged
antonmedv merged 1 commit intodeployphp:masterfrom
adpeyre:local-archive-repo-root
Feb 20, 2026
Merged

Fix local_archive strategy to use git root directory for archive#4168
antonmedv merged 1 commit intodeployphp:masterfrom
adpeyre:local-archive-repo-root

Conversation

@adpeyre
Copy link
Contributor

@adpeyre adpeyre commented Feb 20, 2026

  • Bug fix #…?
  • New feature?
  • BC breaks?
  • Tests added?
  • Docs added?

When using the local_archive deploy strategy, git archive was run from the current working directory, which may differ
from the git repository root. This caused the command to fail when Deployer is invoked from a subdirectory.

This fix resolves the issue by:

  • Resolving the git repository root with git rev-parse --show-toplevel
  • Running git archive explicitly from that root directory using -C
  • Using the full path to the generated archive for both upload() and unlink()

This ensures the strategy works correctly regardless of the directory from which Deployer is invoked.

@antonmedv antonmedv merged commit c78d859 into deployphp:master Feb 20, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants