This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user