fix(dev): shallow clone pull requests
This commit is contained in:
2 files changed
+13
-1
No files matched your search
@@ -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)
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user