Skip to content

My Badges

My Badges 是一个 GitHub Action,用于为你的个人资料 README.md 生成徽章。徽章将每天自动更新。随着你的进步,或者社区添加新的徽章,你将获得新的徽章。是的,你也可以添加自己的徽章

ref-reporef-official-docref-dependent-action

用法

  1. 在仓库中创建一个 .github/workflows/ 目录。
  2. 添加 my-badges.yml 文件,内容如下:
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. 在你的仓库中,创建或编辑 README.md 文件以包含:
markdown
## My Badges
<!-- my-badges start -->
<!-- my-badges end -->

参数

点击显示/关闭参数

名称类型必填默认值参数描述更多描述
ref-actions
env.GITHUB_TOKENstringGitHub 令牌这个工作流将使用默认的运行器令牌。
env.GITHUB_USERstringGitHub 用户名
env.GITHUB_REPOstring{user/user}用于推送徽章的仓库名称
datastring生成徽章的 JSON 路径。如果为空,将所需数据从 GH API 获取。
sizenumber64徽章大小,像素为单位。
dryrunboolean生成徽章,但跳过将它们推送到 git 仓库。
pickstring要选择的徽章列表。传递 --pick="a-commit,ab-commit,revert-revert-commit" 仅生成指定条目。如果为空,获取所有徽章。
omitstring要排除的徽章列表。例如,如果你不好意思炫耀你的星星: --omit=stars-100,stars-500,stars-1000 ,甚至更短: --omit=stars-*
compactboolean在 README.md 中代表最高等级的徽章。例如,如果你有 stars-100stars-500 两种成就,只会显示最后一个。

示例

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