My Badges
My Badges é um GitHub Action que gera emblemas para seu perfil README.md. Esses emblemas serão atualizados todos os dias automaticamente. E você tirar ganhar novos emblemas conforme seu progresso, ou novos emblemas da comunidade. Sim, você pode adicionar seus próprios emblemas!
Uso
- In the repository, create a
.github/workflows/
directory. - 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 }}
- In your repository, create or edit the
README.md
file to include:
markdown
## My Badges
<!-- my-badges start -->
<!-- my-badges end -->
Parâmetros
Clique para exibir/fechar os parâmetros
Nome | Tipo | Obrigatório | Padrão | Descrição | Mais Observações |
---|---|---|---|---|---|
env.GITHUB_TOKEN | string | Token do GitHub | O workflow irá utilizar o token padrão que já está em execução. | ||
env.GITHUB_USER | string | Usuário do GitHub | |||
env.GITHUB_REPO | string | {user/user} | Nome do repositório que vai atualizar os emblemas. | ||
data | string | Caminho para o JSON que irá gerar os emblemas. | Se estiver vazio, os dados necessários serão obtidos da API do GH. | ||
size | number | 64 | Tamanho do emblemas, em pixels. | ||
dryrun | boolean | Gera os emblemas, mas pula o envio para o repositório. | |||
pick | string | Lista de emblemas a serem selecionados. | Passe --pick="a-commit,ab-commit,revert-revert-commit" para gerar apenas os itens especificados. Se vazio, busca todos os emblemas. | ||
omit | string | Lista de emblemas a serem excluídos. | Por exemplo, se você não gosta de brilhar seus estrelas: --omit:stars-100,stars-500,stars-1000 , até mesmo --omit:stars-* . | ||
compact | boolean | Representa os emblemas de maior nível no README.md. | Por exemplo, se você tiver as conquistas de stars-100 e stars-500 , somente a última será mostrada. |
Exemplos
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 <a href="https://github.com/my-badges/my-badges">My Badges</a>!" title="I contributed to <a href="https://github.com/my-badges/my-badges">My Badges</a>!" 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 "ab"." title="One of my commit sha starts with "ab"." 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 "dead" 4 times." title="I pushed a commit with "dead" 4 times." width="64"></a>
<!-- my-badges end -->