Skip to content

A JavaScript tool coupled to a REST API to get aggregated informations of your GitHub organization to your website

License

Notifications You must be signed in to change notification settings

lenra-io/ghorgamel

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Contributors Forks Stargazers Issues MIT License


Ghorgamel

The GitHub Organization Melter is a JavaScript tool coupled to a REST API to get aggregated informations of your GitHub organization to your website.

Report Bug · Request Feature

Getting started

Start a Ghorgamel server with Docker:

docker run -it --rm -p 8080:8080 --env GITHUB_ORGANIZATION="lenra-io" lenra/ghorgamel

Or from the source code:

npm i
GITHUB_ORGANIZATION="lenra-io" npm start

The GITHUB_ORGANIZATION environment variable let you define the GitHub Organization to work with (in this example, lenra-io).

If your organization has many repos, you should use a GitHub API Token with the GITHUB_TOKEN environment variable.

(back to top)

Configure

Ghorgamel can be configured with the next environment variables:

  • GITHUB_ORGANIZATION: the GitHub organization (default: lenra-io)
  • GITHUB_IGNORED_CONTRIBUTORS: the GitHub users' login separated by a coma you want ignor in the contribution aggregation. Useful to ignore bots
  • GITHUB_TOKEN: the GitHub API Token
  • CACHE_DURATION: the cache duration between two API calls to the same URI in milliseconds (default: 3600000 => 1 hour)
  • CORS_ORIGIN: the CORS origin header list (default: * not recommanded for production)
  • PORT: the server exposed port (default: 8080)

(back to top)

REST API

Once up, Ghorgamel exposes some REST API to let you request what you want:

  • /stargazers: returns the number of unique stargazers on all the repos.
  • /contributors: returns a random list of contributors from all the organization repos. The resulting list is limited to 12 contributors by default but it can be overrided with the size query parameter.

(back to top)

Include to your website

You can easely integrate REST API results to your website by using our JavaScript API combine to the basic style.

Just include the basic style to your website:

<link rel="stylesheet" as="style" type="text/css" href="https://<ghorgamel-url>/ghorgamel.css"/>

End the script as placeholder of the content, with the data-type attribute with the wanted content:

<script src="https://<ghorgamel-url>/ghorgamel.js" data-type="contributors" data-size="6" defer></script>

See a complete example in the index.html file.

Stargazers

Display your stargazers number:

    <p>Our organization is having <script src="ghorgamel.js" data-type="stargazers" defer></script> stars.</p>

Contributors

Display some random contributors. You specify the contributors list size with the data-size attribute:

    <script src="ghorgamel.js" data-type="contributors" data-size="6" defer></script>

(back to top)

Contributing

Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.

If you have a suggestion that would make this better, please open an issue with the tag "enhancement". Don't forget to give the project a star if you liked it! Thanks again!

(back to top)

License

Distributed under the MIT License. See LICENSE for more information.

(back to top)

Contact

Lenra - @lenra_dev - contact@lenra.io

Project Link: https://github.com/lenra-io/lesta

(back to top)

About

A JavaScript tool coupled to a REST API to get aggregated informations of your GitHub organization to your website

Resources

License

Stars

Watchers

Forks

Sponsor this project