Open jonocarroll opened 6 years ago
Thanks for checking all that out - that naming as GITHUB_GRAPHQL_TOKEN
was just copied directly from ghrecipes
. I'm not (yet) sure of the details of what is necessary in terms of token access. The query is actually a user
query, yet the properties are all repo
properties. My token was generated by clicking repo
only, @jonocarroll yours for user
only, and they both work, so that's something we've learnt there. Do you wanna try to update the README
and make it more informative? Current form was just a rush job.
@maelle I don't have admin for this repo, so would you please be so kind as to add all participant parties as collaborators?
created a team with write access to this repo
yep I think I remember Jeroen telling me GITHUB_PAT would work just as well, so I should probably change that next time I spend time on ghrecipes
. I myself copied it directly from https://github.com/ropensci/ghql#initialize-client 👼
Upstream issue created: https://github.com/ropensci/ghql/issues/11
Great point on the ghql
issue - ROpenSci is the one institution that can really get some momentum here in terms of nomenclative consistency.
I entirely overlooked that we're the ones enforcing GITHUB_GRAPHQL_TOKEN
, not ghql
. There's complete freedom to choose at the moment.
Proposal:
create_client
could take an env_var
parameter, passed from stars
, default ""
, allowing a user to use an arbitrary environment variable as their token name. Otherwises searches GITHUB_GRAPHQL_TOKEN
then GITHUB_PAT
, taking the first it finds.
## use env_var with precedence, if present
## otherwise use GITHUB_GRAPHQL_TOKEN with precedence, if present
## otherwise use GITHUB_PAT, if present
## otherwise fail
get_token <- function(env_var = "") {
token <- sapply(c(env_var, "GITHUB_GRAPHQL_TOKEN", "GITHUB_PAT"), Sys.getenv)
token <- token[token != ""][1]
if (is.na(token)) stop("NO TOKEN FOUND")
token
}
The
README
instructions state "You'll need to check the box for accessing repository data via the github API v4." -- I suggest this should be clearer as the settings for a new PAT (mine at least) don't mention v4 at all... I read this as instructing to check the box 'repository data via the github API v4' rather than justrepo
(or a subset).Is the token environment variable name
GITHUB_GRAPHQL_TOKEN
a standard for something?devtools
looks forGITHUB_PAT
which I -- and presumably many others -- already have set. Is this specifically a new token or will that one (especially with that name) do the job? In either case the value gets read into session, after which point the name isn't needed, but it would be nice to only have one of those environment variables. My existingGITHUB_PAT
, saved asGITHUB_GRAPHQL_TOKEN
, seems to work.Does
stellar
requirerepo
, oruser
authorization? I created a new token with justuser
and saved it asGITHUB_GRAPHQL_TOKEN
and this appears to work. My originalGITHUB_PAT
is already authorized foruser
so it also works.