Tables like this one are in a lot of repositories, giving well deserved credit to their contributors.
And you know, developers are lazy so there has to be an automation to manage this.
Today’s topic is the all-contributors tool and I will show you how you can integrate it in your project and why you should!
Contributors merging a PR will get a green square in their profile, but not every contribution is actually submitted through a pull request.
That’s why there’s an emoji key table which includes many other actions giving value to the project, such as writing blog posts, mentoring new contributors or answering questions on discord.
Here’s a video where I talk about the two main ways to use this tool which are the Bot and the CLI.
The bot is a GitHub App that will automatically create a Pull Request to add a new contributor to the table.
Once installed, you can invoke it with a comment in an issue or pull request, like this:
@all-contributors please add @balastrong for code
Pros are that it’s automatic, you literally just have to write a comment and the bot will do the rest with the PR ready to be merged. Cons, it spams a little bit of notifications.
Similarly to the bot, once installed in your project you can run the CLI to add a new contributor to the table.
npx all-contributors add balastrong code
Pros: you can control when/how you want to add contributors as it just edits the files locally. Cons: as it’s less automagic, you will need to manually commit and push the changes.
Which one is better? I definitely think it depends on how you want to use it, but both ways are super easy to set up and use.
I’m using it on my github-stats community project and I think it’s a great way to say thank you to everyone involved in the success of an open source project.
Hello! My name is Leonardo and as you might have noticed, I like to talk about Web Development and Open Source!
I use GitHub every day and my favourite editor is Visual Studio Code... this might influence a little bit my conent! :D
If you like what I do, you should have a look at my YouTube Channel!
Let's get in touch, feel free to send me a DM on Twitter!