diff --git a/README.md b/README.md index 0733d5c..80258de 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # action gh-release [![](https://github.com/softprops/action-gh-release/workflows/Main/badge.svg)](https://github.com/softprops/action-gh-release/actions) -A Github Action for creating Github Releases +A GitHub Action for creating GitHub Releases ## Usage @@ -31,10 +31,10 @@ jobs: | Name | Type | Description | |---------|---------|---------------------------------------------------------------| -| `body` | String | text communicating notable changes in this release | -| `draft` | Boolean | indicator of whether or not this release is a draft | -| `files` | String | comma-delimited globs of paths to assets to upload for release| -| `name` | String | name of the release. defaults to tag name | +| `body` | String | Text communicating notable changes in this release | +| `draft` | Boolean | Indicator of whether or not this release is a draft | +| `files` | String | Comma-delimited globs of paths to assets to upload for release| +| `name` | String | Name of the release. defaults to tag name | ## environment variables diff --git a/src/main.rs b/src/main.rs index 1d853f3..3d25d82 100644 --- a/src/main.rs +++ b/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); + } } }