skip_if_no_github <- function(has_scope = NULL) { testthat::skip_if_offline("github.com") testthat::skip_on_cran() if (gh_token() == "") { testthat::skip("No GitHub token") } if (!is.null(has_scope) && !has_scope %in% test_scopes()) { testthat::skip(cli::format_inline("Current token lacks '{has_scope}' scope")) } }