Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pb_download complains with 404 warnings when downloading from private repos #121

Open
tanho63 opened this issue Jan 3, 2024 · 0 comments

Comments

@tanho63
Copy link
Collaborator

tanho63 commented Jan 3, 2024

piggyback fails with 404 errors in private repos now that it's trying the browser download url first.

pb_download(
  file = "iris_example.csv",
  dest = tempdir(),
  repo = "tanho63/piggyback-private",
  tag = "iris",
  .token = Sys.getenv("TAN_GH_TOKEN")
)
#> ℹ Downloading "iris_example.csv"...
#> Downloading: 29 B     Request failed [404]. Retrying in 1 seconds...
#> Downloading: 29 B     Request failed [404]. Retrying in 1.1 seconds...
#>  |====================================================================| 100%

We could include a check in pb_info() as to whether the repo is private or public, e.g.

gh::gh("/repos/tanho63/piggyback-private")$private
#> [1] TRUE

and skip the browser download attempt if private

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant