Skip to content

Commit 71fc627

Browse files
committed
Skip failed downloads from GitHub during release
1 parent 7d8eb93 commit 71fc627

File tree

1 file changed

+12
-5
lines changed

1 file changed

+12
-5
lines changed

src/github.rs

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -54,15 +54,22 @@ async fn fetch_artifact(
5454
org: &str,
5555
repo: &str,
5656
artifact: WorkflowListArtifact,
57-
) -> Result<bytes::Bytes> {
57+
) -> Option<bytes::Bytes> {
5858
println!("downloading artifact {}", artifact.name);
5959

60-
let res = client
60+
let res = match client
6161
.actions()
6262
.download_artifact(org, repo, artifact.id, ArchiveFormat::Zip)
63-
.await?;
63+
.await
64+
{
65+
Ok(res) => res,
66+
Err(err) => {
67+
println!("failed to download artifact {}: {}", artifact.name, err);
68+
return None;
69+
}
70+
};
6471

65-
Ok(res)
72+
Some(res)
6673
}
6774

6875
enum UploadSource {
@@ -272,7 +279,7 @@ pub async fn command_fetch_release_distributions(args: &ArgMatches) -> Result<()
272279
let mut install_paths = vec![];
273280

274281
while let Some(res) = buffered.next().await {
275-
let data = res?;
282+
let Some(data) = res else { continue };
276283

277284
let mut za = ZipArchive::new(std::io::Cursor::new(data))?;
278285
for i in 0..za.len() {

0 commit comments

Comments
 (0)