How to Fix a Stale Contributor Badge
The All Contributors badge shows how many people are listed in your
project’s contributors table (the same people stored in the contributors
list in .all-contributorsrc).
The Bot and the CLI write that contributor count
into the badge URL as a fixed number (for example 13 below). If you edit
.all-contributorsrc by hand, your badge stays stale until the Bot or CLI
runs again.
The <!-- ALL-CONTRIBUTORS-BADGE:... --> comments are markers. They tell the
Bot which lines to update, and it replaces everything between them on each
run.
<!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->[](#contributors-)<!-- ALL-CONTRIBUTORS-BADGE:END -->Use a live badge
Dział zatytułowany „Use a live badge”You can use a shields.io badge that reads the
contributor count from .all-contributorsrc. Set badgeTemplate so the Bot
writes that badge every time.
-
Confirm the badge markers are in your README
Make sure the
ALL-CONTRIBUTORS-BADGEmarkers are in yourREADME.md(or another file you list underfilesin.all-contributorsrc). The Bot only updates the badge between those markers. -
Set
badgeTemplatein.all-contributorsrcAdd a
badgeTemplatewith your GitHub owner and repository name. There are no placeholders, so you need to type them in yourself. This example uses this docs repository:{"badgeTemplate": "[](#contributors-)"}Swap
all-contributors/allcontributors.orgfor your owner and repository. You can also change thecolororstyle. See Change the badge color. -
Let the Bot or CLI run once
The next time the Bot or CLI adds a contributor (or you run
all-contributors generate), it writes the live badge between your markers:<!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->[](#contributors-)<!-- ALL-CONTRIBUTORS-BADGE:END -->From then on, your badge stays in sync with
.all-contributorsrc, including when you edit the list by hand.
Badge not updating?
Dział zatytułowany „Badge not updating?”shields.io reads .all-contributorsrc from your repository’s default branch,
so the count only changes after you merge your edit. shields.io also caches
badges, so the new count can take a short while to appear.
Optional: manage the badge yourself
Dział zatytułowany „Optional: manage the badge yourself”You can paste the live badge into your README and delete both marker comments
if you don’t want the Bot editing that line. The contributor count still
updates, because shields.io reads .all-contributorsrc. With no markers, the
Bot leaves your badge markdown alone.
