From b71984b703b41c11f9df5a353fb6c07ac30c4ad7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ma=C3=ABlle=20Salmon?= Date: Fri, 19 Apr 2024 13:02:55 +0200 Subject: [PATCH 1/2] feat: use gitcreds that will fall back to the environment variable anyway --- DESCRIPTION | 1 + R/utils.R | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/DESCRIPTION b/DESCRIPTION index 27a1f6a..957bd5e 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -18,6 +18,7 @@ Imports: fs, gert, ghql, + gitcreds, here, httr, jsonlite, diff --git a/R/utils.R b/R/utils.R index 0425fb5..6710b29 100644 --- a/R/utils.R +++ b/R/utils.R @@ -21,7 +21,7 @@ symbol_crs <- function () { #' @noRd get_github_user <- function () { - gh_tok <- Sys.getenv ("GITHUB_TOKEN") + gh_tok <- gitcreds::gitcreds_get () # Check corresponding user name: u <- "https://api.github.com/user" From 8b139c8b9dd369871fdc37e8e41d98da826a29e7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ma=C3=ABlle=20Salmon?= Date: Fri, 19 Apr 2024 13:58:45 +0200 Subject: [PATCH 2/2] Update utils.R --- R/utils.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/R/utils.R b/R/utils.R index 6710b29..9b7a742 100644 --- a/R/utils.R +++ b/R/utils.R @@ -21,7 +21,7 @@ symbol_crs <- function () { #' @noRd get_github_user <- function () { - gh_tok <- gitcreds::gitcreds_get () + gh_tok <- gitcreds::gitcreds_get ()$password # Check corresponding user name: u <- "https://api.github.com/user"