Closed yuvipanda closed 3 months ago
FWIW, I've been using:
export GITHUB_ACCESS_TOKEN=$(gh auth token)
github-activity
If that doesn't work, does gh
have a valid token? (check with gh api /user
).
If the token is valid and you can use it in curl:
curl -H "Authorization: Bearer ${GITHUB_ACCESS_TOKEN}" https://api.github.com/user
then you might be hitting requests' weird netrc handling. Do you have anything for api.github.com in your .netrc?
was auto-closed because of a magic string in #97, but would be good to confirm from @yuvipanda first
Unfortunately the issue persists :( I even fully uninstalled gh
to no avail
I installed from main with pip install --force -U git+https://github.com/executablebooks/github-activity@main
curl -H "Accept: application/vnd.github+json" -H "Authorization: Bearer $(gh auth token)" "https://api.github.com/search/issues?q=repo:jupyterhub/jupyter-server-proxy+created:2000-04-02T00:00:00Z..2024-06-12T20:58:22Z"
works. It's the same search query that github-activity
is trying to use and failing
Do you have a .netrc file, and does it have api.github.com in it?
WELL WOULD YOU LOOK AT THAT :)
Good psychic debugging, @minrk!
I think it would be useful for the app to print 'using netrc credentials' or similar maybe, as currently netrc seems to override what's even explicitly passed
Not psychic, personal history! I've been flummoxed by this requests behavior a number of times over the years.
Also, I don't think it's easy for us to detect this because the netrc credentals are loaded deep within requests, so I'm not sure we can warn about it very well. It can be disabled, but not without turning off a bunch of unrelated settings like proxy env, etc. Maybe it's best to disable those, since we aren't likely to use them.
I've tried both classic and new PATs, as well as
gh auth login
.github-activity -t https://github.com/jupyterhub/oauthenticator --since 16.3.0
fails with: