mirror of
https://github.com/softprops/action-gh-release.git
synced 2025-05-10 18:44:19 +00:00
error reporting
This commit is contained in:
parent
43b8a33025
commit
db0b38cbf5
2 changed files with 14 additions and 11 deletions
15
src/main.rs
15
src/main.rs
|
@ -96,19 +96,22 @@ fn run(
|
|||
|
||||
if let Some(patterns) = conf.input_files {
|
||||
for path in paths(patterns)? {
|
||||
println!("⬆️ Uploading asset {}", path.display());
|
||||
let name = &path
|
||||
.file_name()
|
||||
.and_then(OsStr::to_str)
|
||||
.unwrap_or_else(|| "UnknownFile");
|
||||
println!("⬆️ Uploading {}...", name);
|
||||
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"),
|
||||
name,
|
||||
mime_or_default(&path),
|
||||
File::open(&path)?,
|
||||
)?;
|
||||
println!("uploaded with status {}", status);
|
||||
if !status.is_success() {
|
||||
println!("⚠️ Failed uploading {} with error {}", name, status);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue