-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Provide "shortcuts" to kwb.utils' functions
and use new function get_github_token()
- Loading branch information
Showing
23 changed files
with
85 additions
and
59 deletions.
There are no files selected for viewing
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
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,18 @@ | ||
#' Get GitHub rate limit | ||
#' | ||
#' @param github_token token passed to \link[gh]{gh} (default: | ||
#' Sys.getenv("GITHUB_PAT") | ||
#' @param github_token token passed to \link[gh]{gh}. | ||
#' Default: pkgmeta:::get_github_token() | ||
#' @return overview of rate limit | ||
#' @export | ||
#' @importFrom dplyr bind_rows | ||
#' @importFrom gh gh | ||
#' @importFrom kwb.utils selectElements | ||
#' @examples | ||
#' get_gh_ratelimit() | ||
get_gh_ratelimit <- function(github_token = Sys.getenv("GITHUB_PAT")) | ||
get_gh_ratelimit <- function(github_token = get_github_token()) | ||
{ | ||
"https://api.github.com/rate_limit" %>% | ||
gh::gh(.token = github_token) %>% | ||
kwb.utils::selectElements("resources") %>% | ||
select_elements("resources") %>% | ||
dplyr::bind_rows(.id = "id") | ||
} |
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
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
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#' @importFrom kwb.utils catAndRun | ||
cat_and_run <- kwb.utils::catAndRun | ||
|
||
# get_github_token ------------------------------------------------------------- | ||
get_github_token <- function() | ||
{ | ||
Sys.getenv("GITHUB_PAT") | ||
} | ||
|
||
#' @importFrom kwb.utils multiSubstitute | ||
multi_substitute <- kwb.utils::multiSubstitute | ||
|
||
#' @importFrom kwb.utils selectColumns | ||
select_columns <- kwb.utils::selectColumns | ||
|
||
#' @importFrom kwb.utils selectElements | ||
select_elements <- kwb.utils::selectElements | ||
|
||
#' @importFrom kwb.utils stringList | ||
string_list <- kwb.utils::stringList |
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
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.