PSLmodels / PSL-Infrastructure

The Policy Simulation Library consists of models and modeling tools that share the transparency standards and interoperability criteria set by the PSL-Infrastructure project
https://www.pslmodels.org
Other
18 stars 17 forks source link

Use an authentication token to avoid rate limiting #316

Closed jdebacker closed 6 months ago

jdebacker commented 6 months ago

With the list of cataloged and incubating projects, I think we are running up GitHub's API limit of 60 requests per hour for unauthenticated accounts.

This can be avoided by authenticating. E.g. changing the header used for the API request in utils.py to:

HEADER = {'User-Agent': 'request', 'Authorization': 'token ' + token}

Where token is a GitHub authentication token (e.g., your personal token) or a token saved in a repos secrets.

I've tested this locally with my own token and it has helped. But I don't know how to implement this in a way that can pull my (or whoever is running this) personal token for a local run, but then use a GH secretes tokens when running the scripts in a Github Action.

jdebacker commented 6 months ago

Resolved with PR #317