Skip to content

Commit

Permalink
Fix slack-bot. (#1585)
Browse files Browse the repository at this point in the history
  • Loading branch information
dvc94ch authored Feb 24, 2025
1 parent e22634e commit 67212ff
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions slack-bot/src/slack.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ impl SlackState {
pub async fn update_command_info(&self, info: CommandInfo) -> Result<()> {
let session = self.client.open_session(&self.token);
let channel = info.env.channel();
let tag: Option<String> = info.command.tag().map(|tag| tag.chars().take(8).collect());
let content = SlackMessageContent::new()
.with_text(info.command.to_string())
.with_attachments(vec![SlackMessageAttachment::new()
Expand All @@ -61,8 +62,8 @@ impl SlackState {
"*Commit*\n`{} ({})`{}",
&info.commit[..8],
info.command.branch(),
info.command.tag()
.map(|tag| format!("\n\n*Version*\n`{}`", &tag[..8])).unwrap_or_default()
tag
.map(|tag| format!("\n\n*Version*\n`{}`", tag)).unwrap_or_default(),
))
.into(),
],
Expand Down

0 comments on commit 67212ff

Please sign in to comment.