diff --git a/.github/workflows/php.yml b/.github/workflows/php.yml index 23c29bf..4273c5a 100644 --- a/.github/workflows/php.yml +++ b/.github/workflows/php.yml @@ -5,8 +5,6 @@ on: branches: - main pull_request: - branches: - - main permissions: contents: read diff --git a/src/Utils/TarBuilder.php b/src/Utils/TarBuilder.php index ba615e7..40c5e37 100644 --- a/src/Utils/TarBuilder.php +++ b/src/Utils/TarBuilder.php @@ -136,9 +136,16 @@ class TarBuilder private function runTarCommand(string $tarFilePath, string $sourceDir): void { + if (PHP_OS_FAMILY === 'Darwin') { + $additionalFlags = ' --disable-copyfile --no-xattrs'; + } else { + $additionalFlags = ''; + } + // without --disable-copyfile and --no-xattrs combination, tar will fail on macOS $cmd = sprintf( - 'tar --no-xattrs --disable-copyfile -cf %s -C %s . 2>&1', + 'tar %s -cf %s -C %s . 2>&1', + $additionalFlags, escapeshellarg($tarFilePath), escapeshellarg($sourceDir) );