Thanks to Carl and everyone else for piggyback - very much appreciated. We found an issue recently which may impact others.
On hosts which do not cache GitHub credentials, i.e. where gh::gh_token() returns <no PAT>, asset downloads will fail with HTTP 404, even when an explicit personal access token (PAT) is passed into pb_download(). This occurs as pb_download.R:pb_download() doesn't pass its PAT .token parameter onwards into gh_download_asset(). So, currently gh_download_asset() always uses gh::gh_token().
Our fix involves simply passing this .token object as an argument to gh_download_asset() at pb_download.R:86:
gh_download_asset(df$owner[[1]],
df$repo[[1]],
id = df$id[i],
destfile = df$dest[i],
overwrite = overwrite,
.token= .token, # CHANGE: forward the PAT object
progress = progress
))
This should work for PATs originating from gh::gh_token() or passed explicitly into pb_download(). Can provide a pull request if wanted? Thanks again.
Thanks to Carl and everyone else for piggyback - very much appreciated. We found an issue recently which may impact others.
On hosts which do not cache GitHub credentials, i.e. where
gh::gh_token()
returns<no PAT>
, asset downloads will fail with HTTP 404, even when an explicit personal access token (PAT) is passed intopb_download()
. This occurs aspb_download.R:pb_download()
doesn't pass its PAT.token
parameter onwards intogh_download_asset()
. So, currentlygh_download_asset()
always usesgh::gh_token()
.Our fix involves simply passing this
.token
object as an argument togh_download_asset()
atpb_download.R:86
:This should work for PATs originating from
gh::gh_token()
or passed explicitly intopb_download()
. Can provide a pull request if wanted? Thanks again.