languages: Don't remove old artifacts on download failure (#35967)

Release Notes:

- N/A
This commit is contained in:
Lukas Wirth 2025-08-11 09:20:03 +02:00 committed by GitHub
parent c82cd0c6b1
commit 8d332da4c5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 35 additions and 33 deletions

View file

@ -71,11 +71,19 @@ pub async fn latest_github_release(
}
};
releases
let mut release = releases
.into_iter()
.filter(|release| !require_assets || !release.assets.is_empty())
.find(|release| release.pre_release == pre_release)
.context("finding a prerelease")
.context("finding a prerelease")?;
release.assets.iter_mut().for_each(|asset| {
if let Some(digest) = &mut asset.digest {
if let Some(stripped) = digest.strip_prefix("sha256:") {
*digest = stripped.to_owned();
}
}
});
Ok(release)
}
pub async fn get_release_by_tag_name(