mirror of
https://github.com/softprops/action-gh-release.git
synced 2025-05-12 03:14:19 +00:00
print status of uploads
This commit is contained in:
parent
452a2ee738
commit
9003b6a3e7
2 changed files with 17 additions and 17 deletions
|
@ -37,7 +37,7 @@ pub trait AssetUploader<A: Into<Body> = File> {
|
|||
release_id: usize,
|
||||
mime: Mime,
|
||||
asset: A,
|
||||
) -> Result<(), Box<dyn Error>>;
|
||||
) -> Result<StatusCode, Box<dyn Error>>;
|
||||
}
|
||||
|
||||
impl Releaser for Client {
|
||||
|
@ -87,16 +87,17 @@ impl<A: Into<Body>> AssetUploader<A> for Client {
|
|||
release_id: usize,
|
||||
mime: mime::Mime,
|
||||
asset: A,
|
||||
) -> Result<(), Box<dyn Error>> {
|
||||
self.post(&format!(
|
||||
"http://uploads.github.com/repos/{}/releases/{}",
|
||||
github_repo, release_id
|
||||
))
|
||||
.header("Authorization", format!("bearer {}", github_token))
|
||||
.header("Content-Type", mime.to_string())
|
||||
.body(asset)
|
||||
.send()?;
|
||||
Ok(())
|
||||
) -> Result<StatusCode, Box<dyn Error>> {
|
||||
Ok(self
|
||||
.post(&format!(
|
||||
"http://uploads.github.com/repos/{}/releases/{}",
|
||||
github_repo, release_id
|
||||
))
|
||||
.header("Authorization", format!("bearer {}", github_token))
|
||||
.header("Content-Type", mime.to_string())
|
||||
.body(asset)
|
||||
.send()?
|
||||
.status())
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue