Skip to content

Instantly share code, notes, and snippets.

@Schneegans
Last active October 7, 2023 18:20
Show Gist options
  • Save Schneegans/2ab8f1d386f13aaebccbd87dac94068d to your computer and use it in GitHub Desktop.
Save Schneegans/2ab8f1d386f13aaebccbd87dac94068d to your computer and use it in GitHub Desktop.
Example Badges for the Dynamic Badges Action
{"label":"The Answer","message":"is 42","schemaVersion":1,"color":"hsl(50, 100%, 40%)"}
Display the source blob
Display the rendered blob
Raw
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="134" height="20" role="img" aria-label="This is: an SVG badge"><title>This is: an SVG badge</title><linearGradient id="s" x2="0" y2="100%"><stop offset="0" stop-color="#bbb" stop-opacity=".1"/><stop offset="1" stop-opacity=".1"/></linearGradient><clipPath id="r"><rect width="134" height="20" rx="3" fill="#fff"/></clipPath><g clip-path="url(#r)"><rect width="45" height="20" fill="#007ec6"/><rect x="45" width="89" height="20" fill="#e05d44"/><rect width="134" height="20" fill="url(#s)"/></g><g fill="#fff" text-anchor="middle" font-family="Verdana,Geneva,DejaVu Sans,sans-serif" text-rendering="geometricPrecision" font-size="110"><text aria-hidden="true" x="235" y="150" fill="#010101" fill-opacity=".3" transform="scale(.1)" textLength="350">This is</text><text x="235" y="140" transform="scale(.1)" fill="#fff" textLength="350">This is</text><text aria-hidden="true" x="885" y="150" fill="#010101" fill-opacity=".3" transform="scale(.1)" textLength="790">an SVG badge</text><text x="885" y="140" transform="scale(.1)" fill="#fff" textLength="790">an SVG badge</text></g></svg>
{"label":"Coverage","message":"0%","schemaVersion":1,"color":"hsl(0, 100%, 40%)"}
{"label":"Coverage","message":"10%","schemaVersion":1,"color":"hsl(0, 100%, 40%)"}
{"label":"Coverage","message":"100%","schemaVersion":1,"color":"hsl(120, 100%, 40%)"}
{"label":"Coverage","message":"20%","schemaVersion":1,"color":"hsl(0, 100%, 40%)"}
{"label":"Coverage","message":"30%","schemaVersion":1,"color":"hsl(0, 100%, 40%)"}
{"label":"Coverage","message":"40%","schemaVersion":1,"color":"hsl(0, 100%, 40%)"}
{"label":"Coverage","message":"50%","schemaVersion":1,"color":"hsl(0, 100%, 40%)"}
{"label":"Coverage","message":"60%","schemaVersion":1,"color":"hsl(30, 100%, 40%)"}
{"label":"Coverage","message":"70%","schemaVersion":1,"color":"hsl(60, 100%, 40%)"}
{"label":"Coverage","message":"80%","schemaVersion":1,"color":"hsl(90, 100%, 40%)"}
{"label":"Coverage","message":"90%","schemaVersion":1,"color":"hsl(120, 100%, 40%)"}
{
"schemaVersion": 1,
"label": "Hello",
"message": "World",
"color": "orange"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment