Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Show github annotation on specific errors. #106

Merged
11 changes: 11 additions & 0 deletions src/cli/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -723,6 +723,11 @@ async fn push_new_release(
revision = release_metadata.revision
);
if error_if_release_conflicts {
if std::env::var("GITHUB_ACTIONS").is_ok() {
// Output a Github Actions annotation
println!("::error title=Conflict::{upload_name}/{rolling_prefix_or_tag} already exists");
}

return Err(Error::Conflict {
upload_name,
rolling_prefix_or_tag,
Expand All @@ -734,6 +739,12 @@ async fn push_new_release(
StatusCode::UNAUTHORIZED => {
let body = &release_metadata_post_response.bytes().await?;
let message = serde_json::from_slice::<String>(body)?;

if std::env::var("GITHUB_ACTIONS").is_ok() {
// Output a Github Actions annotation
println!("::error title=Unauthorized::{message}");
}

return Err(Error::Unauthorized(message))?;
}
_ => {
Expand Down
Loading