Adding Profile README Stats to Your Github Profile README

Have You ever looked at a Github Profile and saw Github Profile README Stats on it?

Well I’m going to walk you through the Steps of How you can have it also.

Step 1: You Will Need a Github Token:

You will need a Github Personal Access To…


This content originally appeared on DEV Community and was authored by Rishi Chitnis

Have You ever looked at a Github Profile and saw Github Profile README Stats on it?

Image description

Well I'm going to walk you through the Steps of How you can have it also.

Step 1: You Will Need a Github Token:

You will need a Github Personal Access Token with the Following scops

repo and read:user

Image description

Image description

Step 2: You will need to add it to Your Repository's Secrets

You will need to go to your Repo's Settings, Click on Secrets and Variables and then Click on New Secret and Name it Anything you want like USER_TOKEN and add the Personal Access Token from the Previous Step.

Step 3: Create a Template file:

You will Need a Template file for this to work.

Add the Following code:

Joined Github **{{ ACCOUNT_AGE }}** years ago.

Since then I pushed **{{ COMMITS }}** commits, opened **{{ ISSUES }}** issues, submitted **{{ PULL_REQUESTS }}** pull requests, received **{{ STARS }}** stars across **{{ REPOSITORIES }}** personal projects and contributed to **{{ REPOSITORIES_CONTRIBUTED_TO }}** public repositories.

Most used languages across my projects:

{{ LANGUAGE_TEMPLATE_START }}
![{{LANGUAGE_NAME}}](https://img.shields.io/static/v1?style=flat-square&label=%E2%A0%80&color=555&labelColor={{LANGUAGE_COLOR:uri}}&message={{LANGUAGE_NAME:uri}}%EF%B8%B1{{LANGUAGE_PERCENT:uri}}%25)
{{ LANGUAGE_TEMPLATE_END }}

<p align="right"><sub>Generated using <a href="https://github.com/marketplace/actions/profile-readme-stats">teoxoy/profile-readme-stats</a></sub></p>

Step 4: Create The Github Action:

Go to the Actions tab, Click on set up new workflow yourself, and in the .github/workflows directory name your file stats.yml and add the following code:

on:
  workflow_dispatch:
  schedule:
    - cron: '0 */6 * * *' # every 6 hours
  push:
    branches:
      - master
jobs:
  publish:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v4
      with:
        fetch-depth: 0
    - name: Generate README.md
      uses: teoxoy/profile-readme-stats@v3
      with:
        token: ${{ secrets.USER_TOKEN }}
    - name: Update README.md
      run: |
        if [[ "$(git status --porcelain)" != "" ]]; then
        git config user.name github-actions[bot]
        git config user.email 41898282+github-actions[bot]@users.noreply.github.com
        git add .
        git commit -m "Update README"
        git push
       fi

Step 5: Run The Workflow

You should get the following output when you run the workflow, if you don't please feel free to look at My Profile:

Image description

And Boom, Your Profile Stats will automatcally get added every few hours.

See you next time

Bye


This content originally appeared on DEV Community and was authored by Rishi Chitnis


Print Share Comment Cite Upload Translate Updates
APA

Rishi Chitnis | Sciencx (2024-08-03T17:56:41+00:00) Adding Profile README Stats to Your Github Profile README. Retrieved from https://www.scien.cx/2024/08/03/adding-profile-readme-stats-to-your-github-profile-readme/

MLA
" » Adding Profile README Stats to Your Github Profile README." Rishi Chitnis | Sciencx - Saturday August 3, 2024, https://www.scien.cx/2024/08/03/adding-profile-readme-stats-to-your-github-profile-readme/
HARVARD
Rishi Chitnis | Sciencx Saturday August 3, 2024 » Adding Profile README Stats to Your Github Profile README., viewed ,<https://www.scien.cx/2024/08/03/adding-profile-readme-stats-to-your-github-profile-readme/>
VANCOUVER
Rishi Chitnis | Sciencx - » Adding Profile README Stats to Your Github Profile README. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2024/08/03/adding-profile-readme-stats-to-your-github-profile-readme/
CHICAGO
" » Adding Profile README Stats to Your Github Profile README." Rishi Chitnis | Sciencx - Accessed . https://www.scien.cx/2024/08/03/adding-profile-readme-stats-to-your-github-profile-readme/
IEEE
" » Adding Profile README Stats to Your Github Profile README." Rishi Chitnis | Sciencx [Online]. Available: https://www.scien.cx/2024/08/03/adding-profile-readme-stats-to-your-github-profile-readme/. [Accessed: ]
rf:citation
» Adding Profile README Stats to Your Github Profile README | Rishi Chitnis | Sciencx | https://www.scien.cx/2024/08/03/adding-profile-readme-stats-to-your-github-profile-readme/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.