/gh-latest-repos

Microservice to get the latest public GitHub repos from a user

Primary LanguageJavaScriptMIT LicenseMIT

gh-latest-repos

Microservice to get the latest public GitHub repos from a user

I currently use this on my website.

It returns the latest repos along with some metadata. The result is cached for a day.

Example response

Usage

With now

$ git clone https://github.com/sindresorhus/gh-latest-repos.git
$ now gh-latest-repos --env GITHUB_TOKEN=xxx --env GITHUB_USERNAME=xxx --env ACCESS_ALLOW_ORIGIN=xxx --env MAX_REPOS=xxx

Manual

To deploy on your own hosting provider, check out 11e01ac, set the below environment variables, and start it with npm start.

Environment variables

Define the following environment variables:

  • GITHUB_TOKEN - Personal access token.
  • GITHUB_USERNAME - The username you like to get repos from.
  • ACCESS_ALLOW_ORIGIN - The URL of your website or * if you want to allow any origin (not recommended), for the Access-Control-Allow-Origin header.
  • MAX_REPOS - The number of repos returned. Optional. Defaults to 6.