DEV Community

El Bruno for Microsoft Azure

Posted on • Originally published at on

#GitHub – How to display the status badge for a GitHub Action 🟢🔴

Hi !

Last week I wrote 2 posts about

It’s a super cool feature ! 😁

GitHub Actions, are an important part of this series, and on the online event, I had this question:

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”.

GitHub Action definition with Create Status badge option

We can generate the markdown code for this action.

Create Status Badge markdown<br>

The markdown is super simple, and if you want to also use this in other format, like HTML, you just need to add the sufix [/badge.svg] to the action .yml definition.
Enter fullscreen mode Exit fullscreen mode

So, once I added this to the in my repo, I can see that the build action didn’t succeed.

badge in readme with an error

Let’s fix it ! I just need to add an entry HTML file to the Azure Static website, and now it works.

badge in readme succeeded

The sample repo is here:

Happy coding!


El Bruno

More posts in my blog

Top comments (0)