Is there a way to add custom "badges" to files on GitHub?

Viewed 257

I have it in my head to help people at my company get better by finding a way to highlight and call out good code.

In particular, I'd like to be able to mark a file (not a repository or directory) as having a "gold star" (or another badge) so people browsing our source code who see the badge can see they're looking at a really good implementation they might take inspiration from.

I'm taking inspiration from the code owners feature on GitHub where there's a little padlock icon on a file if it's assigned ownership by the CODEOWNERS file.

Is it possible to do a custom "badge" on GitHub? If so, what's the API?

Browsing the GitHub documentation and searching online, I wasn't able to find anything explaining how to do something like this. Most folks were talking about the little images badges like the code coverage badges people put in their readme files.

1 Answers

Checkout this thread. You can submit feature request to GitLab and GitHub or in case of GitLab code your own feature and submit PR.

Here are some closely related discussions. Probably you have already seen them and are not looking for them but you might use them to get idea of how to create the feature that you want.

The Shields service (at shields.io) provides a way to create custom badges for your projects. These are badges are very common and are frequently used to show status information about the project, or demonstrate tools that were used for the development of your project. (...more)

Also checkout Bring Your Own Badge

Related