GitHub Action
Profile Readme Stats
Showcase your github stats on your profile README.md.
This action provides template strings that are replaced with their respective values when the action runs.
- Profile Readme Stats
Required
Personal access token with read:user
scope and optional repo
scope
Generate token here: https://github.com/settings/tokens
Note: repo
scope is needed for taking private repositories into account
Path to template file (default: ./TEMPLATE.md
)
Path to generated file (default: ./README.md
)
Include forked repositories when calculating the stats (default: false
)
Account age in years.
Total number of opened issues across all repositories.
Total number of opened pull requests across all repositories.
Total number of pull requests reviewed across all repositories.
Total number of commits across all repositories. Includes commits in private repositories only if you allowed github to show your private contributions on your profile (check out this link for more info).
Total number of public gists.
Total number of repositories. Includes private repositories if the given personal access token has repo
scope (see more here).
Total number of repositories you contributed to.
Total number of stars on all your gists and repositories.
A region that will be repeated for every language you use in your repositories.
Special template string that signifies the start of the region.
Name of the language.
How often the language is used in your repositories (percentage wise).
Color of the language (in CSS color format ex: #0248AC
).
Special template string that signifies the end of the region.
Will encode the value as an URI component
Example:
{{ LANGUAGE_COLOR:uri }}
Can only be used with LANGUAGE_TEMPLATE_START
Will run the inner template at most max
nr of times
Example:
{{ LANGUAGE_TEMPLATE_START:max=5 }}
This text will be printed at most 5 times
{{ LANGUAGE_TEMPLATE_END }}
on:
schedule:
- cron: '0 */12 * * *' # every 12 hours
push:
branches:
- master
- main
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