Skip to content
Microservice to get the latest public GitHub repos from a user
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.editorconfig
.gitattributes
.gitignore
.travis.yml
example-response.json
github-response.json
index.js
license
package-lock.json
package.json
readme.md
test.js

readme.md

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

Deploy to now

or

$ git clone https://github.com/sindresorhus/gh-latest-repos.git
$ now gh-latest-repos --platform-version 1 --env NODE_ENV=production --env GITHUB_TOKEN=xxx --env GITHUB_USERNAME=xxx --env ACCESS_ALLOW_ORIGIN=xxx --env MAX_REPOS=xxx --env CACHE_MAX_AGE=xxx

Manual

Deploy to your hosting provider, 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.
  • CACHE_MAX_AGE - The maximum age for client cache-control in seconds. Optional. Defaults to 300 (5 minutes).

License

MIT © Sindre Sorhus

You can’t perform that action at this time.