Skip to content

Commit ce1bf5e

Browse files
authored
Merge pull request #2036 from Urgau/assign-use-author-association
Use GitHub author association for determine the welcome message
2 parents b92d7a9 + 1ff7797 commit ce1bf5e

File tree

1 file changed

+5
-9
lines changed

1 file changed

+5
-9
lines changed

src/handlers/assign.rs

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ use crate::{
3131
interactions::EditIssueBody,
3232
};
3333
use anyhow::{bail, Context as _};
34+
use octocrab::models::AuthorAssociation;
3435
use parser::command::assign::AssignCommand;
3536
use parser::command::{Command, Input};
3637
use rand::seq::IteratorRandom;
@@ -195,15 +196,10 @@ pub(super) async fn handle_input(
195196
// want any assignments or noise.
196197
return Ok(());
197198
}
198-
// This is temporarily disabled until we come up with a better
199-
// solution, or decide to remove this. The `is_new_contributor` query
200-
// is too expensive and takes too long to process.
201-
let welcome = if false
202-
&& ctx
203-
.github
204-
.is_new_contributor(&event.repository, &event.issue.user.login)
205-
.await
206-
{
199+
let welcome = if matches!(
200+
event.issue.author_association,
201+
AuthorAssociation::FirstTimer | AuthorAssociation::FirstTimeContributor
202+
) {
207203
let who_text = match &assignee {
208204
Some(assignee) => WELCOME_WITH_REVIEWER.replace("{assignee}", &assignee.name),
209205
None => WELCOME_WITHOUT_REVIEWER.to_string(),

0 commit comments

Comments
 (0)