How to Add Contributors
You can use the All Contributors Bot to recognize a contribution by creating a comment that mentions (using @all-contributors) the Bot. When you mention the Bot in a comment, it reads your comment, extracts both the username of the contributor and the types of contributions that you are asking the Bot to add for them. It then opens a pull request that adds that contributor and their contributions to your project’s contributors table.
In this page you will learn:
- How the Bot parses your comments that mention it
- Different ways you can phrase that comment
- What to expect once a comment is submitted.
This page assumes you have already installed the Bot App (application) in your account and given it access to the repository where you want to use it.
Ask the Bot to add a new contributor
Section titled “Ask the Bot to add a new contributor”To acknowledge a new contributor using the Bot, leave a comment on any issue or pull request in your repository that looks like this:
@all-contributors please add @<username> for <contribution>Replace <username> with the person’s GitHub username. Replace <contribution> with a keyword from the emoji key, such as doc, design, or bug.
What happens next depends on whether the person is already in your contributors table:
-
If they’re a new contributor, the Bot opens a pull request that adds them to your contributors table, and replies with:
@<your-username>I've put up a pull request to add @<username>! 🎉 -
If they’re already listed, the Bot opens a pull request that adds the new contribution (a new emoji) to their existing entry. It replies with the same message:
@<your-username>I've put up a pull request to add @<username>! 🎉 -
If they’re already listed for every contribution you named, the Bot doesn’t open a pull request. Instead, it replies with:
@<your-username>@<username> already contributed before to <contribution>
The Bot always mentions you at the start of its reply, so you get a notification. In the reply, “a pull request” links to the new pull request so you can review and merge it.
If a pull request to add that person is already open, the Bot adds your request to that pull request instead of opening a new one. In that case, it replies with:
@<your-username>
I've updated the pull request to add @<username>! 🎉Add several contribution types for the same contributor
Section titled “Add several contribution types for the same contributor”To credit one person for more than one kind of work, list the contributions after for, separated by commas:
@all-contributors please add @<username> for <contribution>, <contribution>, and <contribution>The Bot replies with the same message as before, no matter how many contributions you name:
@<your-username>
I've put up a pull request to add @<username>! 🎉The pull request title lists the contributions. If you name more than three, the title lists the first two and counts the rest, so it stays short. For example, if you comment @all-contributors please add @jane for code, doc, design, and bug, the pull request title will be:
docs: add jane as a contributor for code, doc, and 2 moreAdd several people in a single comment
Section titled “Add several people in a single comment”You can also add several contributors in a single comment. The Bot splits your comment into sentences and looks for one person in each sentence, so give each person their own sentence.
End each sentence with a period, question mark, or exclamation point, or put each contributor on a new line. A comma doesn’t start a new sentence, so please add @jane for code, add @tom for design is read as one sentence and the Bot gets the username wrong. Two usernames in one sentence, such as please add @jane and @tom for code, doesn’t work either: the Bot only adds the first person.
Both of the following examples work:
@all-contributors please add @jane for code and tests. Please add @tom for design.@all-contributors please add @jane for code and testsplease add @tom for designThe Bot opens a separate pull request for each person. It replies once, with a line for each pull request:
@<your-username>
I've put up a pull request to add @jane! 🎉
I've put up a pull request to add @tom! 🎉Use plain words
Section titled “Use plain words”You don’t need to memorize the exact keywords from the emoji key. The Bot uses natural language parsing to figure out which contribution type you mean, so you can write your request the way you’d normally say it. For example, if you write infrastructure, the Bot knows you mean the infra keyword. These two comments do the exact same thing. Both add Jane for documentation (doc) and infrastructure (infra):
@all-contributors please add @jane for docs and infra@all-contributors please add @jane for documentation and infrastructureThe Bot understands:
- Plurals, such as
bugsortests - Common alternate words, such as
documentationfordocortestingfortest - Two-word phrases, such as
user testingorproject management
If you use a word the Bot doesn’t recognize, it skips that word and adds the other contribution types it can find. For example, please add @jane for docs and cooking adds Jane for doc and leaves out cooking.
If the Bot can’t find any contribution types in your comment, it doesn’t open a pull request. Instead, it replies with:
@<your-username>
I couldn't determine any contributions to add, did you specify any contributions? Please make sure to use valid contribution names.In the reply, “valid contribution names” links to the emoji key. Check it for the words the Bot understands, then try again with a new comment.
Where the Bot listens for mentions
Section titled “Where the Bot listens for mentions”The Bot only responds to new comments that mention @all-contributors (or @allcontributors) followed by a space. You can leave that comment on any issue, or in the Conversation tab of a pull request.
The Bot won’t see:
- Edited comments. If you need to fix a typo in your request, write a new comment instead.
- Comments in a pull request review. This includes comments on specific lines in the Files changed tab, and the summary you write when you submit a review.
