Skip to content

Commit

Permalink
Add reminder to use ready shortcut when using author shortcut
Browse files Browse the repository at this point in the history
  • Loading branch information
Urgau committed Feb 6, 2025
1 parent a9ed2b9 commit da538d8
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions src/handlers/shortcut.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,5 +53,23 @@ pub(super) async fn handle_command(
.await?;
}

// We add a small reminder for the author to the `@bot ready` when ready
if matches!(input, ShortcutCommand::Author) {
if let Event::IssueComment(issue_comment) = event {
let new_comment_body = format!(
"{}\n\n*Use `@{bot} ready` when the PR is ready for another round of review.*",
issue_comment.comment.body,
bot = &ctx.username
);
issue
.edit_comment(
&ctx.github,
issue_comment.comment.id,
new_comment_body.as_str(),
)
.await?;
}
}

Ok(())
}

0 comments on commit da538d8

Please sign in to comment.