Last active
August 7, 2023 20:57
-
-
Save zkamvar/3a10ae2b505dc8335a0b1393f71853ae to your computer and use it in GitHub Desktop.
Get maintainers who still need to confirm that they have reset their local repositories
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#' List maintainers who still need to respond to the Workbench transition issue | |
#' | |
#' @param org the name of the github organisation | |
#' @param repo name of the repository | |
#' @return a character vector of github user names for maintainers who still need to confirm | |
#' transition to The Workbench | |
#' | |
#' @details The Workbench transition requires maintainers to confirm that they have re-cloned | |
#' their local repositories to avoid a situation where they overwrite commits with the old | |
#' version of the repository | |
get_no_response_members <- function(org, repo) { | |
# get the github teams | |
teams <- gh::gh("/repos/{org}/{repo}/teams", org = org, repo = repo) | |
names <- purrr::map_chr(teams, "name") | |
# the teams response will always have a URL where we can access the "members" endpoint | |
# (I believe this requires "org:read" access) | |
team_members <- purrr::map(teams, function(team) gh::gh(glue::glue("{team$url}/members"))) | |
names(team_members) <- names | |
# we only want to compare teams that are "-maintainers" and "-maintainers-workbench" | |
team_members <- team_members[grepl("-maintainers", names)] | |
maintain <- purrr::map(team_members, function(member) purrr::map_chr(member, "login")) | |
if (length(maintain) > 1) { | |
# team members who are not in the workbench team will be returned | |
wb <- endsWith(names(maintain), "-workbench") | |
setdiff(maintain[!wb][[1]], c("maneesha", maintain[wb][[1]])) | |
} else { | |
# if there is no maintainers-workbench team, then we will return null | |
return(NULL) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment