fix(ci): pin shell execution to /bin/sh for runtime and tests

This commit is contained in:
Chummy 2026-03-03 09:00:20 +08:00 committed by Chum Yin
parent b22dc4875e
commit a8958ca728
2 changed files with 4 additions and 4 deletions

View File

@ -579,7 +579,7 @@ async fn run_job_command_with_timeout(
);
}
let mut command = Command::new("sh");
let mut command = Command::new("/bin/sh");
command
.arg("-lc")
.arg(&job.command)

View File

@ -1164,7 +1164,7 @@ mod tests {
#[cfg(not(target_os = "windows"))]
#[test]
fn run_capture_reads_stdout() {
let out = run_capture(Command::new("sh").args(["-lc", "echo hello"]))
let out = run_capture(Command::new("/bin/sh").args(["-lc", "echo hello"]))
.expect("stdout capture should succeed");
assert_eq!(out.trim(), "hello");
}
@ -1172,7 +1172,7 @@ mod tests {
#[cfg(not(target_os = "windows"))]
#[test]
fn run_capture_falls_back_to_stderr() {
let out = run_capture(Command::new("sh").args(["-lc", "echo warn 1>&2"]))
let out = run_capture(Command::new("/bin/sh").args(["-lc", "echo warn 1>&2"]))
.expect("stderr capture should succeed");
assert_eq!(out.trim(), "warn");
}
@ -1180,7 +1180,7 @@ mod tests {
#[cfg(not(target_os = "windows"))]
#[test]
fn run_checked_errors_on_non_zero_status() {
let err = run_checked(Command::new("sh").args(["-lc", "exit 17"]))
let err = run_checked(Command::new("/bin/sh").args(["-lc", "exit 17"]))
.expect_err("non-zero exit should error");
assert!(err.to_string().contains("Command failed"));
}