Skip to content

Commit 7052623

Browse files
committed
Fix: Set GIT_DISCOVERY_ACROSS_FILESYSTEM=1 in build script to resolve cross-filesystem git issues
1 parent 6871807 commit 7052623

1 file changed

Lines changed: 3 additions & 6 deletions

File tree

build.cs

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -41,25 +41,22 @@
4141
Directory.CreateDirectory(wwwrootDir);
4242

4343
// Convert Windows paths to Docker-compatible format (forward slashes)
44-
var astroPath = Path.Combine(repoRoot, "astro").Replace('\\', '/');
44+
var repoRootPath = repoRoot.Replace('\\', '/');
4545
var outputPath = wwwrootDir.Replace('\\', '/');
46-
var gitPath = Path.Combine(repoRoot, ".git").Replace('\\', '/');
4746

4847
// Pass GITHUB_TOKEN into the container if set
4948
var githubToken = Environment.GetEnvironmentVariable("GITHUB_TOKEN") ?? "";
5049

5150
// Use Docker to build Astro - consistent across all platforms
5251
// Use Debian-based image (not Alpine) for better compatibility with native modules
5352
// Increase Node.js memory limit to handle large builds
54-
// Mount .git so git log works inside the container
53+
// Mount repo root so .git is available for git log
5554
await RunAsync("docker",
5655
"run --rm " +
57-
$"-v \"{astroPath}:/app/astro\" " +
56+
$"-v \"{repoRootPath}:/app\" " +
5857
$"-v \"{outputPath}:/output\" " +
59-
$"-v \"{gitPath}:/app/.git\" " +
6058
"-w /app/astro " +
6159
"-e NODE_OPTIONS=\"--max-old-space-size=8192\" " +
62-
"-e GIT_DISCOVERY_ACROSS_FILESYSTEM=1 " +
6360
$"-e GITHUB_TOKEN=\"{githubToken}\" " +
6461
"node:24-slim " +
6562
"sh -c \"apt-get update && apt-get install -y git && git config --global --add safe.directory /app && npm ci && npm run build && cp -r dist/. /output/\"",

0 commit comments

Comments
 (0)