fix: keep CI SSH uploads below provider limits
This commit is contained in:
+5
-1
@@ -548,6 +548,8 @@ function chunks(value: string, size: number): string[] {
|
||||
return result;
|
||||
}
|
||||
|
||||
const hostSshBase64UploadChunkChars = 3000;
|
||||
|
||||
function asRecord(value: unknown): Record<string, unknown> | null {
|
||||
return typeof value === "object" && value !== null && !Array.isArray(value) ? value as Record<string, unknown> : null;
|
||||
}
|
||||
@@ -970,7 +972,9 @@ async function uploadRemoteBase64(path: string, encoded: string, target = ciTarg
|
||||
"chmod 600 \"$target\"",
|
||||
].join("\n"), 20_000, 10_000, true, target);
|
||||
if (!init.ok) return init;
|
||||
for (const chunk of chunks(encoded, 6_000)) {
|
||||
// D601 provider-gateway rejects long host.ssh commands; keep each append
|
||||
// envelope comfortably below the transport limit.
|
||||
for (const chunk of chunks(encoded, hostSshBase64UploadChunkChars)) {
|
||||
const append = await dispatchSsh([
|
||||
"set -euo pipefail",
|
||||
`target=${shellQuote(path)}`,
|
||||
|
||||
Reference in New Issue
Block a user