APixel Visuals
APixel Visuals

Reputation: 1648

GitHub API - Get commit details via access token

With the GitHub API, let's say I have used OAuth and I have the client secret of a user. Let's say I also have a repo, say myname/project, as well as a commit ID, say asdfghjkl123. With this information, I know I can get the details of the commit, but how can I do this on "behalf" of the user? Basically, I want to use the access token I have so that the rate limit is based on the user. Is this even possible?

Upvotes: 1

Views: 162

Answers (1)

VonC
VonC

Reputation: 1329652

As illustrated in this issue

A way to provide a GITHUB_AUTH_TOKEN env var which is attached to GitHub requests to avoid api limits, as in this PR

I always set GITHUB_AUTH_TOKEN to my token before making my curl GitHub API calls: I then benefit from an higher rate limit.

Upvotes: 1

Related Questions