I have read about the way to create and add a custom workflow badge which will show whether the workflow passes or fails. But here's a question. Is it possible to output some percentage data on the badge and how to output this data?
How do I display the current status of the last run of an Action? Lucky me, this one is an easy one. On the Actions section in GitHub, we select the workflow and we have the option to “Create Status Badge”.
A status badge shows whether a workflow is currently failing or passing. A common place to add a status badge is in the README.md file of your repository, but you can add it to any web page you'd like. By default, badges display the status of your default branch.
To obtain your Codacy badge, open your repository Settings, tab General, select the markup language, and copy the generated code to your README file. You can also add a badge for your coverage if you have set up code coverage for your repository.
At the time of writing, there is no badge provided by github to show amount of code coverage, which is the most popular percentage-showing badge. Other CI/CD frameworks usually provide such a badge, most notably and comparably gitlab, and it is very likely that something like that will arrive at some point in the ongoing github actions beta.
If you can't wait that long, one other option you have is to use an external badge service. A very popular one that contains a wide range of coverage badges is shields.io, they might already support the toolchain you're using.
If that is not the case, you can also request a github actions coverage badge from them or even implement it yourself.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With