fix: bot no longer returns an error for non-assign comments and also prints out a debug line

Signed-off-by: mikeee <hey@mike.ee>
This commit is contained in:
mikeee 2024-03-20 20:19:58 +00:00
parent f642bd86c6
commit 7b03b4e02d
No known key found for this signature in database
GPG Key ID: ACED13988580D50E
1 changed files with 4 additions and 2 deletions

View File

@ -43,7 +43,8 @@ async fn main() -> octocrab::Result<()> {
if github_event_name != ISSUE_COMMENT_EVENT_NAME {
println!("Event is not an issue_comment, the app will now exit.");
exit(exitcode::TEMPFAIL);
exit(exitcode::TEMPFAIL); // This failure is because the bot is not
// designed to process anything other than an issue_comment
}
// deserialize event payload
@ -52,7 +53,7 @@ async fn main() -> octocrab::Result<()> {
// check the issue body
if !event.clone().comment.body.unwrap().starts_with("/assign") {
println!("Event does not start with /assign");
exit(exitcode::TEMPFAIL);
exit(exitcode::OK);
}
let assignee: String = event.comment.user.login;
@ -68,6 +69,7 @@ async fn main() -> octocrab::Result<()> {
.await
{
Ok(_) => {
println!("Assigned issue to user successfully");
match github_client
.create_comment(
OWNER,