fix(dev): shallow clone pull requests

This commit is contained in:
Thomas Camlong committed 2026-08-01 23:35:08 +02:00
1 parent c8c5dbc506
commit 934b6e69f4
2 files changed
+13 -1

No files matched your search

+5 -1
View File
@@ -41,7 +41,7 @@ func buildPRImage(ctx context.Context, number int, tag string, stdout, stderr io
defer os.RemoveAll(temporaryRoot)
checkout := filepath.Join(temporaryRoot, "homarr")
clone := exec.CommandContext(ctx, "gh", "repo", "clone", gh.Repo, checkout, "--", "--filter=blob:none")
clone := exec.CommandContext(ctx, "gh", prCloneArgs(checkout)...)
clone.Stdout = stdout
clone.Stderr = stderr
if err := clone.Run(); err != nil {
@@ -67,6 +67,10 @@ func buildPRImage(ctx context.Context, number int, tag string, stdout, stderr io
}, stdout, stderr)
}
func prCloneArgs(checkout string) []string {
return []string{"repo", "clone", gh.Repo, checkout, "--", "--depth=1", "--filter=blob:none"}
}
func RebuildImage(image docker.Image) error {
return RebuildImageContext(context.Background(), image, os.Stdout, os.Stderr)
}