Skip to content

My Badges

My Badges is a GitHub Action that generates badges for your profile README.md. Badges will be updated automatically every day. And you will get new badges as you progress, or as community adds new badges. Yes, you can add your own badges!

ref-reporef-official-docref-dependent-action

Usage

  1. In the repository, create a .github/workflows/ directory.
  2. Add my-badges.yml file with the following content:
yaml
name: my-badges

on:
  workflow_dispatch:
  schedule:
    - cron: '0 0 * * *'

permissions:
  contents: write

jobs:
  my-badges:
    runs-on: ubuntu-latest
    steps:
      - name: Update My Badges
        run: npx update-my-badges ${{github.repository_owner}}
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  1. In your repository, create or edit the README.md file to include:
markdown
## My Badges
<!-- my-badges start -->
<!-- my-badges end -->

Parameters

Click to show/close parameters

NameTypeRequiredDefaultDescriptionMore Description
ref-actions
env.GITHUB_TOKENstringGitHub TokenThe workflow will use a default runner token.
env.GITHUB_USERstringGitHub Username
env.GITHUB_REPOstring{user/user}Repository name to push badges.
datastringPath to JSON to generate badges.If empty, required data will be obtained from the GH API.
sizenumber64Badge size for README.md, px.
dryrunbooleanGenerate badges, but skip pushing them to git.
pickstringList of badges to pick.Pass --pick="a-commit,ab-commit,revert-revert-commit" to generate only the specified entries. If empty gets all of them.
omitstringList of badges to exclude.For example, if you're too shy to flex your stars: --omit:stars-100,stars-500,stars-1000 or even shorter --omit:stars-*.
compactbooleanRepresent the highest tier badges in README.md.For example, If you have both stars-100 and stars-500 achievements, only the last one will be shown.

Examples

markdown
<!-- my-badges start -->
<h4><a href="https://github.com/my-badges/my-badges">My Badges</a></h4>

<a href="my-badges/github-anniversary-10.md"><img src="https://github.com/my-badges/my-badges/blob/master/src/all-badges/github-anniversary/github-anniversary-10.png?raw=true" alt="I joined GitHub 10 years ago." title="I joined GitHub 10 years ago." width="64"></a>
<a href="my-badges/evening-commits.md"><img src="https://github.com/my-badges/my-badges/blob/master/src/all-badges/time-of-commit/evening-commits.png?raw=true" alt="I commit in the evening." title="I commit in the evening." width="64"></a>
<a href="my-badges/my-badges-contributor.md"><img src="https://github.com/my-badges/my-badges/blob/master/src/all-badges/my-badges-contributor/my-badges-contributor.png?raw=true" alt="I contributed to &lt;a href=&quot;https://github.com/my-badges/my-badges&quot;&gt;My Badges&lt;/a&gt;!" title="I contributed to &lt;a href=&quot;https://github.com/my-badges/my-badges&quot;&gt;My Badges&lt;/a&gt;!" width="64"></a>
<a href="my-badges/the-ultimate-question.md"><img src="https://github.com/my-badges/my-badges/blob/master/src/all-badges/the-ultimate-question/the-ultimate-question.png?raw=true" alt="I found the answer to the ultimate question of life, the universe, and everything!" title="I found the answer to the ultimate question of life, the universe, and everything!" width="64"></a>
<a href="my-badges/mass-delete-commit-10k.md"><img src="https://github.com/my-badges/my-badges/blob/master/src/all-badges/mass-delete-commit/mass-delete-commit-10k.png?raw=true" alt="When I delete code, I delete a lot." title="When I delete code, I delete a lot." width="64"></a>
<a href="my-badges/ab-commit.md"><img src="https://github.com/my-badges/my-badges/blob/master/src/all-badges/abc-commit/ab-commit.png?raw=true" alt="One of my commit sha starts with &quot;ab&quot;." title="One of my commit sha starts with &quot;ab&quot;." width="64"></a>
<a href="my-badges/morning-commits.md"><img src="https://github.com/my-badges/my-badges/blob/master/src/all-badges/time-of-commit/morning-commits.png?raw=true" alt="I commit in the morning." title="I commit in the morning." width="64"></a>
<a href="my-badges/old-issue-3.md"><img src="https://github.com/my-badges/my-badges/blob/master/src/all-badges/old-issue/old-issue-3.png?raw=true" alt="I closed an issue that was open for 3 years" title="I closed an issue that was open for 3 years" width="64"></a>
<a href="my-badges/pr-collaboration-10.md"><img src="https://github.com/my-badges/my-badges/blob/master/src/all-badges/pr-collaboration/pr-collaboration-10.png?raw=true" alt="I have participated in pull requests with 10 or more people" title="I have participated in pull requests with 10 or more people" width="64"></a>
<a href="my-badges/fix-5.md"><img src="https://github.com/my-badges/my-badges/blob/master/src/all-badges/fix-commit/fix-5.png?raw=true" alt="I did 5 sequential fixes." title="I did 5 sequential fixes." width="64"></a>
<a href="my-badges/stars-1000.md"><img src="https://github.com/my-badges/my-badges/blob/master/src/all-badges/stars/stars-1000.png?raw=true" alt="I collected 1000 stars." title="I collected 1000 stars." width="64"></a>
<a href="my-badges/dead-commit.md"><img src="https://github.com/my-badges/my-badges/blob/master/src/all-badges/dead-commit/dead-commit.png?raw=true" alt="I pushed a commit with &quot;dead&quot; 4 times." title="I pushed a commit with &quot;dead&quot; 4 times." width="64"></a>
<!-- my-badges end -->

I commit in the evening. I contributed to <a href="https://github.com/my-badges/my-badges">My Badges</a>! I found the answer to the ultimate question of life, the universe, and everything! When I delete code, I delete a lot. One of my commit sha starts with "ab". I commit in the morning. I closed an issue that was open for 3 years I have participated in pull requests with 10 or more people I did 5 sequential fixes. I collected 1000 stars. I pushed a commit with "dead" 4 times.

Readme Widget Hub (v4.3.0) MIT Licensed