Sync public tree to 88f6299

This commit is contained in:
Michel Paulissen 2026-07-04 14:38:16 +02:00
parent 882bc51a9f
commit 4cbb695e42
3 changed files with 17 additions and 3 deletions

View file

@ -146,6 +146,7 @@ for (const [name, pattern] of [
for (const [name, pattern] of [
["preflight rejects stale release manifests", /manifest\.source_commit[\s\S]*currentSourceCommit/],
["preflight disables interactive remote prompts", /function nonInteractiveEnv[\s\S]*GIT_TERMINAL_PROMPT[\s\S]*GIT_ASKPASS[\s\S]*SSH_ASKPASS[\s\S]*git", \["ls-remote"[\s\S]*timeout/],
["preflight accepts external public tree push", /function publicTreeAlreadyPushed\(manifest\)[\s\S]*DISASMER_PUBLIC_TREE_ALREADY_PUSHED/],
["preflight verifies public branch commit", /remoteMain[\s\S]*publicTreeCommit/],
["preflight verifies local asset checksums", /parseSha256Sums[\s\S]*checksum mismatch/],

View file

@ -34,6 +34,16 @@ function commandOutput(command, args, options = {}) {
}
}
function nonInteractiveEnv(extra = {}) {
return {
...process.env,
GIT_TERMINAL_PROMPT: "0",
GIT_ASKPASS: process.env.GIT_ASKPASS || "/bin/false",
SSH_ASKPASS: process.env.SSH_ASKPASS || "/bin/false",
...extra,
};
}
function expectedSourceCommit() {
return (
process.env.DISASMER_ACCEPTANCE_COMMIT ||
@ -62,7 +72,10 @@ function parseSha256Sums(file) {
}
function remoteHead(remote) {
const output = commandOutput("git", ["ls-remote", remote, "HEAD", "refs/heads/main"]);
const output = commandOutput("git", ["ls-remote", remote, "HEAD", "refs/heads/main"], {
env: nonInteractiveEnv(),
timeout: Number(process.env.DISASMER_PUBLIC_REPO_REMOTE_TIMEOUT_MS || 30000),
});
if (!output) return null;
const lines = output.split(/\r?\n/).filter(Boolean);
const head = lines.find((line) => line.endsWith("\tHEAD")) || lines[0];