Skip to content

Commit 372522a

Browse files
authored
Merge pull request dapr#149 from mikeee/bot-fix
fix: bot no longer returns an error for non-assign comments and also …
2 parents 8a28b12 + ac2e6e9 commit 372522a

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

.github/workflows/dapr-bot-test.yml

-2
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@ on:
77
- ".github/workflows/dapr-bot-test.yml"
88
- ".github/workflows/dapr-bot/*"
99
pull_request:
10-
branches:
11-
- main
1210
paths: # Explicitly declare which paths (could potentially be combined into dapr-bot*
1311
- ".github/workflows/dapr-bot.yml"
1412
- ".github/workflows/dapr-bot-test.yml"

.github/workflows/dapr-bot/src/main.rs

+4-2
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,8 @@ async fn main() -> octocrab::Result<()> {
4343

4444
if github_event_name != ISSUE_COMMENT_EVENT_NAME {
4545
println!("Event is not an issue_comment, the app will now exit.");
46-
exit(exitcode::TEMPFAIL);
46+
exit(exitcode::TEMPFAIL); // This failure is because the bot is not
47+
// designed to process anything other than an issue_comment
4748
}
4849

4950
// deserialize event payload
@@ -52,7 +53,7 @@ async fn main() -> octocrab::Result<()> {
5253
// check the issue body
5354
if !event.clone().comment.body.unwrap().starts_with("/assign") {
5455
println!("Event does not start with /assign");
55-
exit(exitcode::TEMPFAIL);
56+
exit(exitcode::OK);
5657
}
5758

5859
let assignee: String = event.comment.user.login;
@@ -68,6 +69,7 @@ async fn main() -> octocrab::Result<()> {
6869
.await
6970
{
7071
Ok(_) => {
72+
println!("Assigned issue to user successfully");
7173
match github_client
7274
.create_comment(
7375
OWNER,

0 commit comments

Comments
 (0)