Skip to content

Commit

Permalink
Fiter bots from contributor list
Browse files Browse the repository at this point in the history
  • Loading branch information
jeroen committed Jul 12, 2024
1 parent 7fc4283 commit 75e92a3
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions R/buildtools.R
Original file line number Diff line number Diff line change
Expand Up @@ -545,16 +545,14 @@ list_contributions <- function(repo){
contributors <- gh::gh(endpoint, .limit = 500, .progress = FALSE)
logins <- tolower(vapply(contributors, function(x){x$login}, character(1)))
counts <- vapply(contributors, function(x){x$contributions}, integer(1))
# Fix for bug in GitHub giving duplicate users
if(anyDuplicated(logins)){
dups <- duplicated(logins)
counts <- counts[!dups]
logins <- logins[!dups]
}

# Filter bots and duplicate users (github bug)
skip <- duplicated(logins) | grepl('[bot]', logins, fixed = TRUE)
counts <- counts[!skip]
logins <- logins[!skip]
structure(as.list(counts), names = logins)
}


#' @export
#' @rdname buildtools
get_gitstats_base64 <- function(repo, pkgdir, url){
Expand Down

0 comments on commit 75e92a3

Please sign in to comment.