Skip to content

Commit de42354

Browse files
authored
Merge pull request #1940 from apiraino/post-comment-when-label-does-not-exist
Post a comment when label does not exist
2 parents ffcf40d + f665df6 commit de42354

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/handlers/relabel.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
1111
use crate::{
1212
config::RelabelConfig,
13+
github::UnknownLabels,
1314
github::{self, Event, GithubClient},
1415
handlers::Context,
1516
interactions::ErrorComment,
@@ -71,6 +72,14 @@ pub(super) async fn handle_command(
7172
event.issue().unwrap().global_id(),
7273
e
7374
);
75+
if let Some(err @ UnknownLabels { .. }) = e.downcast_ref() {
76+
event
77+
.issue()
78+
.unwrap()
79+
.post_comment(&ctx.github, &err.to_string())
80+
.await?;
81+
}
82+
7483
return Err(e);
7584
}
7685

0 commit comments

Comments
 (0)