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
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.
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 botsGITHUB_TOKEN
: the GitHub API TokenCACHE_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
)
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 thesize
query parameter.
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.
Display your stargazers number:
<p>Our organization is having <script src="ghorgamel.js" data-type="stargazers" defer></script> stars.</p>
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>
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!
Distributed under the MIT License. See LICENSE for more information.
Lenra - @lenra_dev - contact@lenra.io
Project Link: https://github.com/lenra-io/lesta