Skip to content

Commit

Permalink
refactor: More reliable identification of user type
Browse files Browse the repository at this point in the history
  • Loading branch information
akash1810 committed Oct 23, 2024
1 parent 7afe69d commit b08480d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/github.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ pub struct GithubLabel {
pub struct GithubUser {
pub id: usize,
pub login: String,
pub r#type: String,
}

#[derive(Deserialize, Debug)]
Expand Down
2 changes: 1 addition & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ fn make_message(pull_request: GithubPullRequest, show_pr_age: bool) -> String {
"".to_string()
};

let user = if pull_request.user.login.contains("[bot]") {
let user = if pull_request.user.r#type.to_lowercase() == "bot" {
format!("🤖 {}", pull_request.user.login)
} else {
format!("👤 {}", pull_request.user.login)
Expand Down

0 comments on commit b08480d

Please sign in to comment.