Schneegans / dynamic-badges-action

This action allows you to create badges for your README.md with shields.io which may change with every commit. To do this, this action does not need to push anything to your repository!
https://schneegans.github.io/tutorials/2022/04/18/badges
MIT License
257 stars 37 forks source link

Added a new feature to allow a color range #11

Closed LucasWolfgang closed 2 years ago

LucasWolfgang commented 2 years ago

Hi, I added a feature in this fork that allows the user to define a range and provide a value using 3 new arguments, 'min', 'max' and 'value'. I felt the need of having such feature when running workflows that provided a score and not just a pass/fail response, such as pylint. The new section in the index.json file makes sure the value provided is within the range and calculate a color betwen green and red, providing a HSL value to shield.io, besides also formating the resulting message. One last parameter was added, which allows the user to invert the range, making the smaller value green, and a bigger one, red. This is useful for tests that return number of error, such as flake 8

Schneegans commented 2 years ago

I'll do some minor formatting stuff and write some documentation after this is merged. Thanks again! I'm looking forward to your future contributions :wink: