add default image docker fallback
ci/woodpecker/push/tests Pipeline was successful

This commit is contained in:
2026-09-22 20:57:21 +00:00
parent 589d337057
commit e7b8048992
11 changed files with 266 additions and 125 deletions
+9 -5
View File
@@ -50,12 +50,16 @@ impl Sandbox {
clone_pull_request(clone_url, token, pull_request_number, &repo_dir).await?;
make_readable(&repo_dir).await?;
let devcontainer_path = find_devcontainer(&repo_dir)
.with_context(|| format!("no devcontainer found in `{clone_url}`"))?;
let devcontainer = match find_devcontainer(&repo_dir) {
Some(path) => devcontainer_rs::parse(&path).await?,
None => {
info!(
"no devcontainer found in the pull request, falling back to the default image"
);
devcontainer_rs::DevContainer::default()
}
};
let devcontainer = devcontainer_rs::parse(&devcontainer_path).await?;
info!(image = %devcontainer.image_tag(), "Building and starting sandbox container");
let container = devcontainer.up(runtime, &repo_dir).await?;
let sandbox = Self {