Closed bschilder closed 2 years ago
Reprex on Windows, I think?
testthat::with_mock(
`gh::gh_token` = function()"",
piggyback::pb_download(file = "timestamp.json",
dest = ".",
repo = "nflverse/nflverse-data",
tag = "misc"
)
)
ℹ Downloading "timestamp.json"...
|======================================================================================| 100%
Warning message:
In gh_download_asset(df$owner[[1]], df$repo[[1]], id = df$id[i], :
Unauthorized (HTTP 401).
I'll look a bit closer when I get a chance!
@bschilder I just skimmed your get_data.R function - you might be able to get your package to CRAN sooner/without this update if you explicitly set .token = NULL in pb_download (or perhaps as the default argument on the outer wrapper) - it looks like the repo you want to access is public anyway
Thanks for the quick reply @tanho63! I'll try the .token=NULL
in the meantime, thanks for the suggestion.
Trying something like this:
.token <- gh::gh_token()
if(as.character(.token)=="") .token <- NULL
@tanho63 should we queue a new CRAN release then?
@bschilder I'd probably do
get_data <- function(fname,
repo = "neurogenomics/MAGMA_Celltyping",
storage_dir = tempdir(),
overwrite = FALSE,
.token = NULL, # set new default token to NULL since your package repo is public
check = FALSE) {
piggyback::pb_download(
file = fname,
dest = storage_dir,
repo = repo,
.token = .token, # use the token passed in from above with new default as NULL
overwrite = overwrite
)
# etc
}
@cboettig It's probably a good idea but unsure if it's too soon since last release
Hello,
During a recent check run by CRAN on our R package
MAGMA.Celltyping
, it was found that piggyback wasn't able to download assets from GitHub on Windows when a GH PAT wasn't supplied. I'm unable to supply a GH token since the checks are being run on CRAN's servers.This is reminiscent of a previous issue (#49), but appears to be only happening on Windows currently. The error message is coming from a check that I added when this was happening on all OS. I don't think this is showing up in your GHA checks bc I believe you're supplying your GHA PAT in as a global workflow variable.
This recently posted Issue seems to also be related: #76
Best, Brian