This project is a GitHub Contributor Ranking system built using Jekyll. It displays the top contributors of any GitHub repository, ranking them based on their number of commits and lines of code contributed. Each contributor's profile includes details such as:
- Avatar
- Name
- Bio
- Location
- Number of followers
- Commits
- Lines of code
The top three contributors are highlighted in Gold, Silver, and Bronze, making the leaderboard visually appealing and rewarding to view.
- Provide a ranking system for contributors to any GitHub repository.
- Display important contributor meta information in a simple and responsive UI.
- Use GitHub Actions to automate fetching contributor data daily, ensuring the rankings are always up to date.
To begin, clone the repository to your local machine:
git clone <repo-link>
cd <repo-directory>
Ensure that you have Ruby and Bundler installed. If you don't have them, install them using the following commands:
sudo apt-get install ruby-full
gem install bundler
Then, install Jekyll:
gem install jekyll bundler
Navigate to your project folder and install the required gems by running:
bundle install
This project requires a GitHub token to interact with the GitHub API. Here's how to generate one:
- Visit GitHub Settings.
- Click on Generate new token.
- Give the token a name and enable the following scopes:
repo
read:user
- Copy the generated token and store it securely.
In your project, you'll need to set up the GitHub token in your environment. Create an .env
file in the project directory:
touch .env
Inside the .env
file, add your GitHub token like this:
GITHUB_TOKEN=<your-personal-access-token>
In the _config.yml
file, you need to update the repository information:
json:
- name: contributors
src: "https://api.github.com/repos/<user_name>/<repository_name>/contributors"
headers:
Authorization: "token {{ site.github_token }}"
Replace <user_name>
and <repository_name>
with the GitHub repository's owner and name. Do the same in fetch_contributor_data.rb
line 6.
To fetch contributor data, run the following command:
ruby fetch_contributor_data.rb
This will generate a _data/contributors.json
file, which the Jekyll site will use to display contributor rankings.
Now, you're ready to run the Jekyll site locally. Start the server using:
bundle exec jekyll serve
Visit http://localhost:4000/
in your browser to see the contributor rankings.
This project uses GitHub Actions to automate the daily update of contributor data. The action defined in update_contributions.yml
fetches new data every day at midnight UTC and commits the updated data to the repository.
To enable this:
- Ensure the repository is pushed to GitHub.
- In the GitHub repository, go to Settings > Secrets > Actions and add your GITHUB_TOKEN as a secret.
The action will run automatically according to the schedule set in the update_contributions.yml
file.
This GitHub Contributor Ranking project allows you to easily configure it for any GitHub repository. It highlights key contributor data and is fully responsive with a modern design. Automated updates ensure that the data is always fresh, making it a powerful tool for tracking and showcasing contributor efforts.