mirror of
https://github.com/softprops/action-gh-release.git
synced 2025-05-11 19:04:20 +00:00
assets need names
This commit is contained in:
parent
d2478527cf
commit
c7f2407010
2 changed files with 11 additions and 8 deletions
13
src/main.rs
13
src/main.rs
|
@ -6,6 +6,7 @@ use reqwest::Client;
|
|||
use serde::Deserialize;
|
||||
use std::{
|
||||
error::Error,
|
||||
ffi::OsStr,
|
||||
fs::File,
|
||||
path::{Path, PathBuf},
|
||||
};
|
||||
|
@ -95,17 +96,17 @@ fn run(
|
|||
|
||||
if let Some(patterns) = conf.input_files {
|
||||
for path in paths(patterns)? {
|
||||
println!(
|
||||
"⬆️ Uploading {} asset {}",
|
||||
mime_or_default(&path),
|
||||
path.display()
|
||||
);
|
||||
println!("⬆️ Uploading asset {}", path.display());
|
||||
let status = uploader.upload(
|
||||
conf.github_token.as_str(),
|
||||
conf.github_repository.as_str(),
|
||||
id,
|
||||
&path
|
||||
.file_name()
|
||||
.and_then(OsStr::to_str)
|
||||
.unwrap_or_else(|| "Unknown file"),
|
||||
mime_or_default(&path),
|
||||
File::open(path)?,
|
||||
File::open(&path)?,
|
||||
)?;
|
||||
println!("uploaded with status {}", status);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue